Skip to content

Commit 405b191

Browse files
committed
fix bug
1 parent 4ee61d5 commit 405b191

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

utils/build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Do this as the first thing so that any code reading it knows the right env.
22
process.env.BABEL_ENV = 'production';
33
process.env.NODE_ENV = 'production';
4+
process.env.ASSET_PATH = '/';
45

56
var webpack = require('webpack'),
67
config = require('../webpack.config');
78

89
delete config.chromeExtensionBoilerplate;
910

10-
webpack(config, function(err) {
11+
webpack(config, function (err) {
1112
if (err) throw err;
1213
});

utils/webserver.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Do this as the first thing so that any code reading it knows the right env.
22
process.env.BABEL_ENV = 'development';
33
process.env.NODE_ENV = 'development';
4+
process.env.ASSET_PATH = '/';
45

56
var WebpackDevServer = require('webpack-dev-server'),
67
webpack = require('webpack'),

webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ var webpack = require('webpack'),
77
HtmlWebpackPlugin = require('html-webpack-plugin'),
88
TerserPlugin = require('terser-webpack-plugin');
99

10+
const ASSET_PATH = process.env.ASSET_PATH || '/';
11+
1012
// load the secrets
1113
var alias = {
1214
'react-dom': '@hot-loader/react-dom',
@@ -45,6 +47,7 @@ var options = {
4547
output: {
4648
path: path.join(__dirname, 'build'),
4749
filename: '[name].bundle.js',
50+
publicPath: ASSET_PATH,
4851
},
4952
module: {
5053
rules: [

0 commit comments

Comments
 (0)