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