From ed6c121d4d69e0590bfcf0d38600747fda0b903f Mon Sep 17 00:00:00 2001 From: Jake Niemiec Date: Wed, 9 Jan 2019 16:55:36 -0600 Subject: [PATCH] [ci skip] docs: warn about errant use of `devDependencies` --- docs/yarn.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/yarn.md b/docs/yarn.md index d8b48383b..dca2d4ab4 100644 --- a/docs/yarn.md +++ b/docs/yarn.md @@ -1,6 +1,6 @@ # Yarn -Webpacker by default uses `yarn` as package manager for node modules +Webpacker by default uses `yarn` as a package manager for `node_modules` ## Add a new npm module @@ -10,3 +10,14 @@ To add any new JS module you can use `yarn`: ```bash yarn add bootstrap material-ui ``` + +## Add an npm module to `devDependencies` +To add a new JS module that will only be available to local development: + +```bash +yarn add --dev browser-sync +``` + +Be careful not to add any build or app related JS modules in this fashion. Adding JS modules to `devDependencies` [will block them from being installed in **any** production environment](https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-production-true-false). + +Docs from JS modules may instruct you to use `--dev` or `devDependencies`, but this is generally under the assumption that you are using a `node.js` workflow.