@@ -38,6 +38,8 @@ const getCacheIdentifier = require('react-dev-utils/getCacheIdentifier');
38
38
// @remove -on-eject-end
39
39
const postcssNormalize = require ( 'postcss-normalize' ) ;
40
40
41
+ const BUILD_ID = process . env . REACT_APP_BUILD_ID || '' ;
42
+
41
43
const appPackageJson = require ( paths . appPackageJson ) ;
42
44
43
45
// Source maps are resource heavy and can cause out of memory issue for large source files.
@@ -184,14 +186,14 @@ module.exports = function(webpackEnv) {
184
186
// There will be one main bundle, and one file per asynchronous chunk.
185
187
// In development, it does not produce real files.
186
188
filename : isEnvProduction
187
- ? ' static/js/[name].[contenthash:8].js'
188
- : isEnvDevelopment && ' static/js/bundle.js' ,
189
+ ? ` static- ${ BUILD_ID } /js/[name].[contenthash:8].js`
190
+ : isEnvDevelopment && ` static- ${ BUILD_ID } /js/bundle.js` ,
189
191
// TODO: remove this when upgrading to webpack 5
190
192
futureEmitAssets : true ,
191
193
// There are also additional JS chunk files if you use code splitting.
192
194
chunkFilename : isEnvProduction
193
- ? ' static/js/[name].[contenthash:8].chunk.js'
194
- : isEnvDevelopment && ' static/js/[name].chunk.js' ,
195
+ ? ` static- ${ BUILD_ID } /js/[name].[contenthash:8].chunk.js`
196
+ : isEnvDevelopment && ` static- ${ BUILD_ID } /js/[name].chunk.js` ,
195
197
// We inferred the "public path" (such as / or /my-project) from homepage.
196
198
// We use "/" in development.
197
199
publicPath : publicPath ,
@@ -396,7 +398,7 @@ module.exports = function(webpackEnv) {
396
398
loader : require . resolve ( 'url-loader' ) ,
397
399
options : {
398
400
limit : imageInlineSizeLimit ,
399
- name : ' static/media/[name].[hash:8].[ext]' ,
401
+ name : ` static- ${ BUILD_ID } /media/[name].[hash:8].[ext]` ,
400
402
} ,
401
403
} ,
402
404
// Process application JS with Babel.
@@ -570,7 +572,7 @@ module.exports = function(webpackEnv) {
570
572
// by webpacks internal loaders.
571
573
exclude : [ / \. ( j s | m j s | j s x | t s | t s x ) $ / , / \. h t m l $ / , / \. j s o n $ / ] ,
572
574
options : {
573
- name : ' static/media/[name].[hash:8].[ext]' ,
575
+ name : ` static- ${ BUILD_ID } /media/[name].[hash:8].[ext]` ,
574
576
} ,
575
577
} ,
576
578
// ** STOP ** Are you adding a new loader?
@@ -644,8 +646,8 @@ module.exports = function(webpackEnv) {
644
646
new MiniCssExtractPlugin ( {
645
647
// Options similar to the same options in webpackOptions.output
646
648
// both options are optional
647
- filename : ' static/css/[name].[contenthash:8].css' ,
648
- chunkFilename : ' static/css/[name].[contenthash:8].chunk.css' ,
649
+ filename : ` static- ${ BUILD_ID } /css/[name].[contenthash:8].css` ,
650
+ chunkFilename : ` static- ${ BUILD_ID } /css/[name].[contenthash:8].chunk.css` ,
649
651
} ) ,
650
652
// Generate an asset manifest file with the following content:
651
653
// - "files" key: Mapping of all asset filenames to their corresponding
0 commit comments