Skip to content

Commit f0ee283

Browse files
author
Eduard Kyvenko
committed
feat($webpack-config): Added an option to specify the publicPath using environment valiable SERVED_P
The production distribution now can have configurable path for serving the assets
1 parent f828fe0 commit f0ee283

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

config/webpack.config.prod.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const autoprefixer = require('autoprefixer');
2-
const webpack = require('webpack');
32
const DefinePlugin = require('webpack/lib/DefinePlugin');
43
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');
54
const HtmlWebpackPlugin = require('html-webpack-plugin');
@@ -22,7 +21,7 @@ module.exports = {
2221
path: paths.dist,
2322

2423
// Append leading slash when production assets are referenced in the html.
25-
publicPath: '/',
24+
publicPath: process.env.SERVED_PATH || '/',
2625

2726
// Generated JS files.
2827
filename: 'js/[name].[chunkhash:8].js'

0 commit comments

Comments
 (0)