diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-04-06 02:40:12 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-04-06 14:24:17 +0800 |
commit | dfff23b4c906bf6913686c3bacfb316af45eaa35 (patch) | |
tree | c08f79b2700ce47c70c73ae071226416fd06a067 | |
parent | aaa49c2c4e9473726814e3ce183c2e3e4072d64b (diff) | |
download | gitlab-ce-dfff23b4c906bf6913686c3bacfb316af45eaa35.tar.gz |
Make webpack host configurableconfigure-webpack-host
-rw-r--r-- | config/webpack.config.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js index 69d8c5640f7..80e3f3ec41a 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -10,6 +10,7 @@ var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlug var ROOT_PATH = path.resolve(__dirname, '..'); var IS_PRODUCTION = process.env.NODE_ENV === 'production'; var IS_DEV_SERVER = process.argv[1].indexOf('webpack-dev-server') !== -1; +var DEV_SERVER_HOST = process.env.DEV_SERVER_HOST || 'localhost'; var DEV_SERVER_PORT = parseInt(process.env.DEV_SERVER_PORT, 10) || 3808; var DEV_SERVER_LIVERELOAD = process.env.DEV_SERVER_LIVERELOAD !== 'false'; var WEBPACK_REPORT = process.env.WEBPACK_REPORT; @@ -173,12 +174,13 @@ if (IS_PRODUCTION) { if (IS_DEV_SERVER) { config.devtool = 'cheap-module-eval-source-map'; config.devServer = { + host: DEV_SERVER_HOST, port: DEV_SERVER_PORT, headers: { 'Access-Control-Allow-Origin': '*' }, stats: 'errors-only', inline: DEV_SERVER_LIVERELOAD }; - config.output.publicPath = '//localhost:' + DEV_SERVER_PORT + config.output.publicPath; + config.output.publicPath = '//' + DEV_SERVER_HOST + ':' + DEV_SERVER_PORT + config.output.publicPath; } if (WEBPACK_REPORT) { |