publicPath is ../ for styles, and optionally uses envar for everything else

This commit is contained in:
QWp6t
2017-01-09 13:32:38 -08:00
parent bfb3ef7873
commit ce6024cde4
2 changed files with 7 additions and 2 deletions

View File

@@ -40,3 +40,6 @@ module.exports = mergeWithConcat(config, {
manifest: {},
});
if (config.enabled.watcher && !process.env.WEBPACK_PUBLIC_PATH) {
process.env.WEBPACK_PUBLIC_PATH = config.publicPath;
}

View File

@@ -49,6 +49,7 @@ let webpackConfig = {
include: config.paths.assets,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style',
publicPath: '../',
loader: [
`css?${sourceMapQueryStr}`,
'postcss',
@@ -60,6 +61,7 @@ let webpackConfig = {
include: config.paths.assets,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style',
publicPath: '../',
loader: [
`css?${sourceMapQueryStr}`,
'postcss',
@@ -140,8 +142,8 @@ let webpackConfig = {
'window.Tether': 'tether',
}),
new webpack.DefinePlugin({
WEBPACK_PUBLIC_PATH: (config.enabled.watcher)
? JSON.stringify(config.publicPath)
WEBPACK_PUBLIC_PATH: (process.env.WEBPACK_PUBLIC_PATH)
? JSON.stringify(process.env.WEBPACK_PUBLIC_PATH)
: false,
}),
new webpack.LoaderOptionsPlugin({