mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 08:33:43 +00:00
Split webpack config into 3 files (base, dev, production).
This commit is contained in:
@@ -27,7 +27,7 @@ def run_watch(port):
|
|||||||
# type: (str) -> None
|
# type: (str) -> None
|
||||||
"""watches and rebuilds on changes, serving files from memory via webpack-dev-server"""
|
"""watches and rebuilds on changes, serving files from memory via webpack-dev-server"""
|
||||||
subprocess.Popen(['node', 'node_modules/.bin/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 = argparse.ArgumentParser()
|
||||||
parser.add_argument('--watch',
|
parser.add_argument('--watch',
|
||||||
|
|||||||
@@ -2,21 +2,10 @@ var path = require('path');
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: [
|
entry: [
|
||||||
'webpack-dev-server/client?http://0.0.0.0:9991/socket.io',
|
|
||||||
'./static/js/src/main.js',
|
'./static/js/src/main.js',
|
||||||
],
|
],
|
||||||
devtool: 'eval',
|
|
||||||
output: {
|
output: {
|
||||||
publicPath: 'http://0.0.0.0:9991/webpack/',
|
|
||||||
path: path.resolve(__dirname, '../static/js'),
|
path: path.resolve(__dirname, '../static/js'),
|
||||||
filename: 'bundle.js',
|
filename: 'bundle.js',
|
||||||
},
|
},
|
||||||
devServer: {
|
|
||||||
port: 9994,
|
|
||||||
stats: "errors-only",
|
|
||||||
watchOptions: {
|
|
||||||
aggregateTimeout: 300,
|
|
||||||
poll: 1000,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|||||||
16
tools/webpack.dev.config.js
Normal file
16
tools/webpack.dev.config.js
Normal 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;
|
||||||
@@ -1,9 +1,3 @@
|
|||||||
var path = require('path');
|
var config = require('./webpack.config.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = config;
|
||||||
entry: './static/js/src/main.js',
|
|
||||||
output: {
|
|
||||||
path: path.resolve(__dirname, '../static/js'),
|
|
||||||
filename: 'bundle.js',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user