Skip to content

Commit ed6c121

Browse files
authored
[ci skip] docs: warn about errant use of devDependencies
1 parent c8375de commit ed6c121

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/yarn.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Yarn
22

3-
Webpacker by default uses `yarn` as package manager for node modules
3+
Webpacker by default uses `yarn` as a package manager for `node_modules`
44

55

66
## Add a new npm module
@@ -10,3 +10,14 @@ To add any new JS module you can use `yarn`:
1010
```bash
1111
yarn add bootstrap material-ui
1212
```
13+
14+
## Add an npm module to `devDependencies`
15+
To add a new JS module that will only be available to local development:
16+
17+
```bash
18+
yarn add --dev browser-sync
19+
```
20+
21+
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).
22+
23+
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.

0 commit comments

Comments
 (0)