feat(webpack): configure publicPath via ASSET_BASE_URL env var (#15105)

This commit is contained in:
ʈᵃᵢ
2021-06-14 17:55:58 -07:00
committed by GitHub
parent e2abf59534
commit 98ec365374

View File

@@ -50,10 +50,11 @@ const {
} = parsedArgs;
const isDevMode = mode !== 'production';
const isDevServer = process.argv[1].includes('webpack-dev-server');
const ASSET_BASE_URL = process.env.ASSET_BASE_URL || '';
const output = {
path: BUILD_DIR,
publicPath: '/static/assets/', // necessary for lazy-loaded chunks
publicPath: `${ASSET_BASE_URL}/static/assets/`,
};
if (isDevMode) {
output.filename = '[name].[hash:8].entry.js';