Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ module.exports = {
publicPath: publicPath
},
resolve: {
// This ensures that create-react-app's node_modules are first checked before
// other module locations (e.g. NODE_PATH). Without this, if NODE_PATH has
// the same module, webpack will use it before the dependency specified in our
// node modules.
// https://github.com/facebookincubator/create-react-app/issues/1023
root: paths.ownNodeModules,
// This allows you to set a fallback for where Webpack should look for modules.
// We read `NODE_PATH` environment variable in `paths.js` and pass paths here.
// We use `fallback` instead of `root` because we want `node_modules` to "win"
Expand Down
6 changes: 6 additions & 0 deletions packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ module.exports = {
publicPath: publicPath
},
resolve: {
// This ensures that create-react-app's node_modules are first checked before
// other module locations (e.g. NODE_PATH). Without this, if NODE_PATH has
// the same module, webpack will use it before the dependency specified in our
// node modules.
// https://github.com/facebookincubator/create-react-app/issues/1023
root: paths.ownNodeModules,
// This allows you to set a fallback for where Webpack should look for modules.
// We read `NODE_PATH` environment variable in `paths.js` and pass paths here.
// We use `fallback` instead of `root` because we want `node_modules` to "win"
Expand Down