File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed
Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ const { scriptVersion } = require('./utils/paths');
66const overrides = require ( '../config-overrides' ) ;
77const scriptPkg = require ( `${ scriptVersion } /package.json` ) ;
88
9+ const pathsConfigPath = `${ scriptVersion } /config/paths.js` ;
10+ const pathsConfig = require ( pathsConfigPath ) ;
11+
12+ // override paths in memory
13+ require . cache [ require . resolve ( pathsConfigPath ) ] . exports =
14+ overrides . paths ( pathsConfig , process . env . NODE_ENV ) ;
15+
916// CRA 2.1.2 switched to using a webpack config factory
1017// https://github.com/facebook/create-react-app/pull/5722
1118// https://github.com/facebook/create-react-app/releases/tag/v2.1.2
@@ -19,12 +26,5 @@ require.cache[require.resolve(webpackConfigPath)].exports = isWebpackFactory
1926 ? ( env ) => overrides . webpack ( webpackConfig ( env ) , env )
2027 : overrides . webpack ( webpackConfig , process . env . NODE_ENV ) ;
2128
22- const pathsConfigPath = `${ scriptVersion } /config/paths.js` ;
23- const pathsConfig = require ( pathsConfigPath ) ;
24-
25- // override paths in memory
26- require . cache [ require . resolve ( pathsConfigPath ) ] . exports =
27- overrides . paths ( pathsConfig , process . env . NODE_ENV ) ;
28-
2929// run original script
3030require ( `${ scriptVersion } /scripts/build` ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ const { scriptVersion } = require('./utils/paths');
66const overrides = require ( '../config-overrides' ) ;
77const scriptPkg = require ( `${ scriptVersion } /package.json` ) ;
88
9+ const pathsConfigPath = `${ scriptVersion } /config/paths.js` ;
10+ const pathsConfig = require ( pathsConfigPath ) ;
11+
12+ // override paths in memory
13+ require . cache [ require . resolve ( pathsConfigPath ) ] . exports =
14+ overrides . paths ( pathsConfig , process . env . NODE_ENV ) ;
15+
916// CRA 2.1.2 switched to using a webpack config factory
1017// https://github.com/facebook/create-react-app/pull/5722
1118// https://github.com/facebook/create-react-app/releases/tag/v2.1.2
@@ -24,12 +31,5 @@ require.cache[require.resolve(webpackConfigPath)].exports = isWebpackFactory
2431require . cache [ require . resolve ( devServerConfigPath ) ] . exports =
2532 overrides . devServer ( devServerConfig , process . env . NODE_ENV ) ;
2633
27- const pathsConfigPath = `${ scriptVersion } /config/paths.js` ;
28- const pathsConfig = require ( pathsConfigPath ) ;
29-
30- // override paths in memory
31- require . cache [ require . resolve ( pathsConfigPath ) ] . exports =
32- overrides . paths ( pathsConfig , process . env . NODE_ENV ) ;
33-
3434// run original script
3535require ( `${ scriptVersion } /scripts/start` ) ;
You can’t perform that action at this time.
0 commit comments