Commit 4878eae1 authored by Mike Greiling's avatar Mike Greiling

disable webpack proxy in rspec environment due to conflicts with webmock gem

parent cd6a6ff7
...@@ -16,21 +16,29 @@ if app.config.serve_static_files ...@@ -16,21 +16,29 @@ if app.config.serve_static_files
# If webpack-dev-server is configured, proxy webpack's public directory # If webpack-dev-server is configured, proxy webpack's public directory
# instead of looking for static assets # instead of looking for static assets
if Gitlab.config.webpack.dev_server.enabled if Gitlab.config.webpack.dev_server.enabled
app.config.webpack.dev_server.merge!( dev_server = {
enabled: true, enabled: true,
host: Gitlab.config.gitlab.host, host: Gitlab.config.webpack.dev_server.host,
port: Gitlab.config.gitlab.port, port: Gitlab.config.webpack.dev_server.port,
https: Gitlab.config.gitlab.https,
manifest_host: Gitlab.config.webpack.dev_server.host, manifest_host: Gitlab.config.webpack.dev_server.host,
manifest_port: Gitlab.config.webpack.dev_server.port, manifest_port: Gitlab.config.webpack.dev_server.port,
) }
app.config.middleware.insert_before( if Rails.env.development?
Gitlab::Middleware::Static, dev_server.merge!(
Gitlab::Middleware::WebpackProxy, host: Gitlab.config.gitlab.host,
proxy_path: app.config.webpack.public_path, port: Gitlab.config.gitlab.port,
proxy_host: Gitlab.config.webpack.dev_server.host, https: Gitlab.config.gitlab.https,
proxy_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,
)
end
app.config.webpack.dev_server.merge!(dev_server)
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment