Merge pull request #4646 from chrisgarrity/webconfig-static-path

Set static asset path (publicPath) with environment var
This commit is contained in:
chrisgarrity authored and GitHub committed 2019-03-18 09:52:05 +01:00
commit b26ac6d62b
1 file changed
+4 -2
+4 -2
View File
@@ -12,6 +12,8 @@ var autoprefixer = require('autoprefixer');
var postcssVars = require('postcss-simple-vars');
var postcssImport = require('postcss-import');
const STATIC_PATH = process.env.STATIC_PATH || '/static';
const base = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
devtool: 'cheap-module-source-map',
@@ -195,7 +197,7 @@ module.exports = [
output: {
libraryTarget: 'umd',
path: path.resolve('dist'),
publicPath: '/static/'
publicPath: `${STATIC_PATH}/`
},
externals: {
React: 'react',
@@ -208,7 +210,7 @@ module.exports = [
loader: 'file-loader',
options: {
outputPath: 'static/assets/',
publicPath: '/static/assets/'
publicPath: `${STATIC_PATH}/assets/`
}
}
])