@@ -38,6 +38,8 @@ const getCacheIdentifier = require('react-dev-utils/getCacheIdentifier');
3838// @remove -on-eject-end
3939const postcssNormalize = require ( 'postcss-normalize' ) ;
4040
41+ const BUILD_ID = process . env . REACT_APP_BUILD_ID || '' ;
42+
4143const appPackageJson = require ( paths . appPackageJson ) ;
4244
4345// Source maps are resource heavy and can cause out of memory issue for large source files.
@@ -184,14 +186,14 @@ module.exports = function(webpackEnv) {
184186 // There will be one main bundle, and one file per asynchronous chunk.
185187 // In development, it does not produce real files.
186188 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` ,
189191 // TODO: remove this when upgrading to webpack 5
190192 futureEmitAssets : true ,
191193 // There are also additional JS chunk files if you use code splitting.
192194 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` ,
195197 // We inferred the "public path" (such as / or /my-project) from homepage.
196198 // We use "/" in development.
197199 publicPath : publicPath ,
@@ -396,7 +398,7 @@ module.exports = function(webpackEnv) {
396398 loader : require . resolve ( 'url-loader' ) ,
397399 options : {
398400 limit : imageInlineSizeLimit ,
399- name : ' static/media/[name].[hash:8].[ext]' ,
401+ name : ` static- ${ BUILD_ID } /media/[name].[hash:8].[ext]` ,
400402 } ,
401403 } ,
402404 // Process application JS with Babel.
@@ -570,7 +572,7 @@ module.exports = function(webpackEnv) {
570572 // by webpacks internal loaders.
571573 exclude : [ / \. ( j s | m j s | j s x | t s | t s x ) $ / , / \. h t m l $ / , / \. j s o n $ / ] ,
572574 options : {
573- name : ' static/media/[name].[hash:8].[ext]' ,
575+ name : ` static- ${ BUILD_ID } /media/[name].[hash:8].[ext]` ,
574576 } ,
575577 } ,
576578 // ** STOP ** Are you adding a new loader?
@@ -644,8 +646,8 @@ module.exports = function(webpackEnv) {
644646 new MiniCssExtractPlugin ( {
645647 // Options similar to the same options in webpackOptions.output
646648 // 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` ,
649651 } ) ,
650652 // Generate an asset manifest file with the following content:
651653 // - "files" key: Mapping of all asset filenames to their corresponding
0 commit comments