-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Package react-scripts is installed as not a dev dependency #2696
Comments
This is intentional and was made in v1.0.8. See #2657 |
This is intentional as your application relies on polyfills provided by the package, warrantying a dependency. |
@gaearon, what was the reasoning for this change? I found it pretty confusing (so I opened the ticket) since it's expected behavior after 6+ years of using NPM. |
It fixes deployment issues on some hosting providers that assume only dependencies are needed for the build. The line is also very thin in frontend development. None of them are "runtime" dependencies because we don't have a server and they all get bundled into a single file. So if we were pedantic then we would have to declare everything as devDependencies, including React itself. I just figured that it's not worth conceptual overhead anyway since distinction is largely arbitrary. For example polyfills could be categorised as either. |
Couldn't it be done as just a part of Deployment/Troubleshooting part in README then? |
Sure, but we generally try for more things to work out of the box. This is a good example of an issue that can be debated endlessly because there's very little technical arguments for and against. I've made a choice there and if you disagree, you can always move those few lines. |
The polyfills should be moved out to a "react-polyfills" package, then. "scripts" does not imply polyfills. |
What technical problem are you having? |
Semantics. |
You can move it in your Again, unless you’re building a Node.js app, the most correct semantics would be to put everything into |
|
If you are using npm, run this command will move all packages except $ npm i voy -g && voy mg '^(?!react)' |
And for the devDependencies issue, I just found this: facebook/create-react-app#2696 the conclusion is CRA remove devDependencies on purpose.
@gaearon I can no longer identify which licenses are used in production and which are just for build tools. |
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Yes
Which terms did you search for in User Guide?
(Write your answer here if relevant.)
Environment
node -v
:8.0.0
npm -v
:5.0.3
yarn --version
(if you use Yarn):npm ls react-scripts
(if you haven’t ejected):1.0.10
create-react-app --version
:1.3.3
Then, specify:
Steps to Reproduce
Expected Behavior
Package
react-scripts
should appear indevDependencies
sectionActual Behavior
Package
react-scripts
appears next toreact-dom
independencies
section.Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
The text was updated successfully, but these errors were encountered: