Split webpack config into 3 files (base, dev, production).

This commit is contained in:
Mehanig
2017-05-23 12:51:04 -07:00
committed by Tim Abbott
parent 573e06260a
commit 4f39d4fc22
4 changed files with 19 additions and 20 deletions

View File

@@ -27,7 +27,7 @@ def run_watch(port):
# type: (str) -> None
"""watches and rebuilds on changes, serving files from memory via webpack-dev-server"""
subprocess.Popen(['node', 'node_modules/.bin/webpack-dev-server'] +
['--config', 'tools/webpack.config.js', '--watch-poll', '--port', port])
['--config', 'tools/webpack.dev.config.js', '--watch-poll', '--port', port])
parser = argparse.ArgumentParser()
parser.add_argument('--watch',

View File

@@ -2,21 +2,10 @@ var path = require('path');
module.exports = {
entry: [
'webpack-dev-server/client?http://0.0.0.0:9991/socket.io',
'./static/js/src/main.js',
],
devtool: 'eval',
output: {
publicPath: 'http://0.0.0.0:9991/webpack/',
path: path.resolve(__dirname, '../static/js'),
filename: 'bundle.js',
},
devServer: {
port: 9994,
stats: "errors-only",
watchOptions: {
aggregateTimeout: 300,
poll: 1000,
},
},
};

View File

@@ -0,0 +1,16 @@
var config = require('./webpack.config.js');
config.entry.push('webpack-dev-server/client?http://0.0.0.0:9991/socket.io');
config.devtool = 'eval';
config.output.publicPath = 'http://0.0.0.0:9991/webpack/';
config.devServer = {
port: 9994,
stats: "errors-only",
watchOptions: {
aggregateTimeout: 300,
poll: 1000,
},
};
module.exports = config;

View File

@@ -1,9 +1,3 @@
var path = require('path');
var config = require('./webpack.config.js');
module.exports = {
entry: './static/js/src/main.js',
output: {
path: path.resolve(__dirname, '../static/js'),
filename: 'bundle.js',
},
};
module.exports = config;