Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about errant use of devDependencies #1880

Merged
merged 1 commit into from
Jan 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.