diff options
author | Phil Hughes <me@iamphill.com> | 2017-01-19 09:41:38 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-01-19 09:41:38 +0000 |
commit | c5b7cc54e9bfceda7d48b1f15bcf064a0d96c07d (patch) | |
tree | d250a8804618ca175588343ca087c3d5e95d7f3b /config/webpack.config.js | |
parent | 0d2ae3e7c15254aa366665cd0323ba9b7845da70 (diff) | |
download | gitlab-ce-c5b7cc54e9bfceda7d48b1f15bcf064a0d96c07d.tar.gz |
Use webpack_port file if it exists
Diffstat (limited to 'config/webpack.config.js')
-rw-r--r-- | config/webpack.config.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js index 762147e8b06..bddd181b452 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -1,5 +1,6 @@ 'use strict'; +var fs = require('fs'); var path = require('path'); var webpack = require('webpack'); var StatsPlugin = require('stats-webpack-plugin'); @@ -10,7 +11,13 @@ 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 -var DEV_SERVER_PORT = 3808; +var DEV_SERVER_PORT; + +try { + DEV_SERVER_PORT = parseInt(fs.readFileSync('../webpack_port'), 10); +} catch (e) { + DEV_SERVER_PORT = 3808; +} var config = { context: path.join(ROOT_PATH, 'app/assets/javascripts'), |