Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ var autoprefixer = require('autoprefixer');
var postcssVars = require('postcss-simple-vars');
var postcssImport = require('postcss-import');

const BASE_PATH = process.env.BASE_PATH || '/';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Judging by the way it's used, it looks like this might be more convenient / descriptive:

Suggested change
const BASE_PATH = process.env.BASE_PATH || '/';
const STATIC_PATH = process.env.STATIC_PATH || '/static';

I defer to {@chrisG, @paulkaplan, @rschamp}'s opinion though ;)


const base = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
devtool: 'cheap-module-source-map',
Expand Down Expand Up @@ -195,7 +197,7 @@ module.exports = [
output: {
libraryTarget: 'umd',
path: path.resolve('dist'),
publicPath: '/static/'
publicPath: `${BASE_PATH}static/`
},
externals: {
React: 'react',
Expand All @@ -208,7 +210,7 @@ module.exports = [
loader: 'file-loader',
options: {
outputPath: 'static/assets/',
publicPath: 'static/assets/'
publicPath: `${BASE_PATH}static/assets`
}
}
])
Expand Down