File tree 2 files changed +10
-2
lines changed
packages/react-scripts/config
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,9 @@ module.exports = {
82
82
// We use `fallback` instead of `root` because we want `node_modules` to "win"
83
83
// if there any conflicts. This matches Node resolution mechanism.
84
84
// https://github.com/facebookincubator/create-react-app/issues/253
85
- fallback : paths . nodePaths ,
85
+ // We also fallback to the app's node_modules to support hoisted modules in a
86
+ // linked package workflow.
87
+ fallback : [ paths . appNodeModules ] . concat ( paths . nodePaths ) ,
86
88
// These are the reasonable defaults supported by the Node ecosystem.
87
89
// We also include JSX as a common component filename extension to support
88
90
// some tools, although we do not recommend using it, see:
@@ -99,6 +101,8 @@ module.exports = {
99
101
// directory of `react-scripts` itself rather than the project directory.
100
102
resolveLoader : {
101
103
root : paths . ownNodeModules ,
104
+ // Fallback to any hoisted modules when dealing with linked libraries
105
+ fallback : paths . appNodeModules ,
102
106
moduleTemplates : [ '*-loader' ]
103
107
} ,
104
108
// @remove -on-eject-end
Original file line number Diff line number Diff line change @@ -86,7 +86,9 @@ module.exports = {
86
86
// We use `fallback` instead of `root` because we want `node_modules` to "win"
87
87
// if there any conflicts. This matches Node resolution mechanism.
88
88
// https://github.com/facebookincubator/create-react-app/issues/253
89
- fallback : paths . nodePaths ,
89
+ // We also fallback to the app's node_modules to support hoisted modules in a
90
+ // linked package workflow.
91
+ fallback : [ paths . appNodeModules ] . concat ( paths . nodePaths ) ,
90
92
// These are the reasonable defaults supported by the Node ecosystem.
91
93
// We also include JSX as a common component filename extension to support
92
94
// some tools, although we do not recommend using it, see:
@@ -103,6 +105,8 @@ module.exports = {
103
105
// directory of `react-scripts` itself rather than the project directory.
104
106
resolveLoader : {
105
107
root : paths . ownNodeModules ,
108
+ // Fallback to any hoisted modules when dealing with linked libraries
109
+ fallback : paths . appNodeModules ,
106
110
moduleTemplates : [ '*-loader' ]
107
111
} ,
108
112
// @remove -on-eject-end
You can’t perform that action at this time.
0 commit comments