Create-react-app: The devDependencies and dependencies are not separated in package.json

Created on 30 Sep 2017  路  2Comments  路  Source: facebook/create-react-app

Do you want to request a feature or report a bug?
I'm not sure if it's a bug or a feature.

What is the current behavior?
When i run npm run eject the generated react app contains a package.json with all the dependencies both devDependencies and dependencies on the same key, in dependencies.

What is the expected behavior?
We should have seen two keys in package.json

  • devDependencies
  • dependencies

Which versions of React, and which browser / OS are affected by this issue?
1.4.1

Most helpful comment

Actually, @tharakawj , please consider reopening. The discussion on #2696 is about what behavior should be for un-ejected dependencies. I have no qualm or quibble with that decision, which seems to be a compromise to minimize admin overhead for fully-encapsulated users. But @sarbull is asking about the eject use-case.

When someone ejects, they're essentially opting out of the 'fire-and-forget' approach: they need something that works in a self-administered environment, with traditional CI. Wouldn't it be reasonable - again, _only_ in the eject case - to assume that most build-time dependencies formerly in react-scripts would appropriately go into devDependencies?

(Yes, it's clearly possible for someone to do this themselves. Which I've already done. I'm asking more in the sense of: as good stewards for the community, and definers of best practices, what approach does the CRA team want to suggest is best-practice?)

All 2 comments

This question has been raised a few times before. See the discussion #2696. So I'm closing this issue. But please feel free to comment if you have something more to add there.

Actually, @tharakawj , please consider reopening. The discussion on #2696 is about what behavior should be for un-ejected dependencies. I have no qualm or quibble with that decision, which seems to be a compromise to minimize admin overhead for fully-encapsulated users. But @sarbull is asking about the eject use-case.

When someone ejects, they're essentially opting out of the 'fire-and-forget' approach: they need something that works in a self-administered environment, with traditional CI. Wouldn't it be reasonable - again, _only_ in the eject case - to assume that most build-time dependencies formerly in react-scripts would appropriately go into devDependencies?

(Yes, it's clearly possible for someone to do this themselves. Which I've already done. I'm asking more in the sense of: as good stewards for the community, and definers of best practices, what approach does the CRA team want to suggest is best-practice?)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wereHamster picture wereHamster  路  3Comments

DaveLindberg picture DaveLindberg  路  3Comments

stopachka picture stopachka  路  3Comments

oltsa picture oltsa  路  3Comments

adrice727 picture adrice727  路  3Comments