diff options
author | Mike Greiling <mike@pixelcog.com> | 2016-10-19 23:56:42 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-01-06 19:21:02 +0300 |
commit | 000180e5e469c39f626faccf91cdb2b1d25a97f8 (patch) | |
tree | 68b85d10a0d9fe83a59ae6e478301117a4584c98 /config | |
parent | 61ca496b3227b977e5bbf4001e1a88e398c87737 (diff) |
conditionally apply webpack-dev-server config
Diffstat (limited to 'config')
-rw-r--r-- | config/webpack.config.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js index 5d285e5fc40..2aa1e8d7dd7 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -5,6 +5,7 @@ var webpack = require('webpack'); var StatsPlugin = require('stats-webpack-plugin'); var IS_PRODUCTION = process.env.NODE_ENV === 'production'; +var IS_DEV_SERVER = process.argv[1].indexOf('webpack-dev-server') !== -1; var ROOT_PATH = path.resolve(__dirname, '..'); // must match config.webpack.dev_server.port @@ -66,7 +67,9 @@ if (IS_PRODUCTION) { new webpack.optimize.DedupePlugin(), new webpack.optimize.OccurrenceOrderPlugin() ); -} else { +} + +if (IS_DEV_SERVER) { config.devServer = { port: DEV_SERVER_PORT, headers: { 'Access-Control-Allow-Origin': '*' } |