Skip to content

Commit

Permalink
[ci skip] docs: warn about errant use of devDependencies (#1880)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeNiemiec authored and gauravtiwari committed Jan 14, 2019
1 parent e32685f commit 404751f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/yarn.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.

0 comments on commit 404751f

Please sign in to comment.