summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2016-10-19 15:56:42 -0500
committerMike Greiling <mike@pixelcog.com>2017-01-06 10:21:02 -0600
commit000180e5e469c39f626faccf91cdb2b1d25a97f8 (patch)
tree68b85d10a0d9fe83a59ae6e478301117a4584c98
parent61ca496b3227b977e5bbf4001e1a88e398c87737 (diff)
downloadgitlab-ce-000180e5e469c39f626faccf91cdb2b1d25a97f8.tar.gz
conditionally apply webpack-dev-server config
-rw-r--r--config/webpack.config.js5
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': '*' }