mirror of https://github.com/apache/superset.git
feat(webpack): configure publicPath via ASSET_BASE_URL env var (#15105)
This commit is contained in:
parent
e2abf59534
commit
98ec365374
|
@ -50,10 +50,11 @@ const {
|
||||||
} = parsedArgs;
|
} = parsedArgs;
|
||||||
const isDevMode = mode !== 'production';
|
const isDevMode = mode !== 'production';
|
||||||
const isDevServer = process.argv[1].includes('webpack-dev-server');
|
const isDevServer = process.argv[1].includes('webpack-dev-server');
|
||||||
|
const ASSET_BASE_URL = process.env.ASSET_BASE_URL || '';
|
||||||
|
|
||||||
const output = {
|
const output = {
|
||||||
path: BUILD_DIR,
|
path: BUILD_DIR,
|
||||||
publicPath: '/static/assets/', // necessary for lazy-loaded chunks
|
publicPath: `${ASSET_BASE_URL}/static/assets/`,
|
||||||
};
|
};
|
||||||
if (isDevMode) {
|
if (isDevMode) {
|
||||||
output.filename = '[name].[hash:8].entry.js';
|
output.filename = '[name].[hash:8].entry.js';
|
||||||
|
|
Loading…
Reference in New Issue