If I use yarn add <package-name>
, Yarn will install both dependencies and devDependencies of <package-name>
.
Is it intended?
I checked the documentation but I couldn't find a way to prevent installing the development dependencies.
devDependencies
are the dependencies that were used to compile the sources of one package, therefore if I am in a production environment I don't need them.
--production
flag doesn't exist anymore. Use this command instead:
yarn workspaces focus --production
More details here https://yarnpkg.com/cli/workspaces/focus
Use --production=true
(or simply --production
or --prod
for short). It is indeed normal behaviour; Yarn assumes you are in a 'development' context unless your NODE_ENV environment variable is set to 'production'.
Have a look at Yarn's documentation.