diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-02-02 19:46:47 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-02-02 19:46:47 +0300 |
commit | 5a099315eb29c345925141609dc5a3a395312016 (patch) | |
tree | f6282461d2e84d12c1a2b54f2e132dc2ce6d1f9a /config/initializers/static_files.rb | |
parent | deb2fa20a9ba97bba9105942c81e7b8ce34d566e (diff) |
disable webpack proxy in rspec environment due to conflicts with webmock gem
Diffstat (limited to 'config/initializers/static_files.rb')
-rw-r--r-- | config/initializers/static_files.rb | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/config/initializers/static_files.rb b/config/initializers/static_files.rb index 718cdd51782..cb332e15c11 100644 --- a/config/initializers/static_files.rb +++ b/config/initializers/static_files.rb @@ -16,21 +16,29 @@ 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 - app.config.webpack.dev_server.merge!( + dev_server = { enabled: true, - host: Gitlab.config.gitlab.host, - port: Gitlab.config.gitlab.port, - https: Gitlab.config.gitlab.https, + 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, - ) + } - app.config.middleware.insert_before( - 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, - ) + if Rails.env.development? + dev_server.merge!( + host: Gitlab.config.gitlab.host, + port: Gitlab.config.gitlab.port, + https: Gitlab.config.gitlab.https, + ) + app.config.middleware.insert_before( + 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, + ) + end + + app.config.webpack.dev_server.merge!(dev_server) end end |