diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-02-02 14:07:33 -0600 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-02-02 14:07:33 -0600 |
commit | dbcf24c268a4bb9b949a6c94d40a04fc4c56ff90 (patch) | |
tree | 52ba63b967e0a2ae750adbabbc6416da92ecd9c3 /config | |
parent | 7ca57c59c8b29dfbf714b9921583f3544c76bdb3 (diff) | |
download | gitlab-ce-dbcf24c268a4bb9b949a6c94d40a04fc4c56ff90.tar.gz |
DRY with Gitlab.config.webpack.dev_server referenceswebpack
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/static_files.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/config/initializers/static_files.rb b/config/initializers/static_files.rb index cb332e15c11..74aba6c5d06 100644 --- a/config/initializers/static_files.rb +++ b/config/initializers/static_files.rb @@ -15,17 +15,19 @@ if app.config.serve_static_files # If webpack-dev-server is configured, proxy webpack's public directory # instead of looking for static assets - if Gitlab.config.webpack.dev_server.enabled - dev_server = { + dev_server = Gitlab.config.webpack.dev_server + + if dev_server.enabled + settings = { enabled: true, - host: Gitlab.config.webpack.dev_server.host, - port: Gitlab.config.webpack.dev_server.port, - manifest_host: Gitlab.config.webpack.dev_server.host, - manifest_port: Gitlab.config.webpack.dev_server.port, + host: dev_server.host, + port: dev_server.port, + manifest_host: dev_server.host, + manifest_port: dev_server.port, } if Rails.env.development? - dev_server.merge!( + settings.merge!( host: Gitlab.config.gitlab.host, port: Gitlab.config.gitlab.port, https: Gitlab.config.gitlab.https, @@ -34,11 +36,11 @@ if app.config.serve_static_files Gitlab::Middleware::Static, Gitlab::Middleware::WebpackProxy, proxy_path: app.config.webpack.public_path, - proxy_host: Gitlab.config.webpack.dev_server.host, - proxy_port: Gitlab.config.webpack.dev_server.port, + proxy_host: dev_server.host, + proxy_port: dev_server.port, ) end - app.config.webpack.dev_server.merge!(dev_server) + app.config.webpack.dev_server.merge!(settings) end end |