I was just going through the docker-compose.dev.yml file in a nodejs boilerplate project HERE and came across the following lines of code :-
version: "2"
services:
boilerplate-api:
command: yarn dev -- -L
environment:
- NODE_ENV=development
I really cannot find any documentation for the -- -L flag and what it does. Would appreciate if somebody could shed some light on this.
There seems to be no such options on the yarn website HERE too.
P.S.
The file gets used in a command in the package.json file like so:-
"docker:dev": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml up",
CodePudding user response:
The dev
command that yarn runs is defined like this in package.json
"dev": "nodemon ./src/index.js"
The -- -L
notation means that the -L
option is passed to the command run, so the actual command run is
nodemon ./src/index.js -L
The -L option for nodemon means that it should use 'legacy watch'. I'm not exactly sure what that is, but hopefully this is enough to explain what's going on.