Skip to content
代码片段 群组 项目
提交 a2ba70ec 编辑于 作者: Rajendra Kadam's avatar Rajendra Kadam 提交者: Luke Duncalfe
浏览文件

Revert "Proxy webpack dev server in test environment"

This reverts commit 7afca793.
上级 ea200219
No related branches found
No related tags found
无相关合并请求
...@@ -83,8 +83,16 @@ def webpack_entrypoint_paths(source, extension: nil, exclude_duplicates: true) ...@@ -83,8 +83,16 @@ def webpack_entrypoint_paths(source, extension: nil, exclude_duplicates: true)
end end
def webpack_public_host def webpack_public_host
# We proxy webpack output in 'test' and 'dev' environment, so we can just use asset_host # We do not proxy the webpack output in the 'test' environment,
ActionController::Base.asset_host.try(:chomp, '/') # so we must reference the webpack dev server directly.
if Rails.env.test? && Gitlab.config.webpack.dev_server.enabled
host = Gitlab.config.webpack.dev_server.host
port = Gitlab.config.webpack.dev_server.port
protocol = Gitlab.config.webpack.dev_server.https ? 'https' : 'http'
"#{protocol}://#{host}:#{port}"
else
ActionController::Base.asset_host.try(:chomp, '/')
end
end end
def webpack_public_path def webpack_public_path
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
# 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 && Gitlab.dev_or_test_env? if Gitlab.config.webpack.dev_server.enabled && Rails.env.development?
app.config.middleware.insert_before( app.config.middleware.insert_before(
Gitlab::Middleware::Static, Gitlab::Middleware::Static,
Gitlab::Webpack::DevServerMiddleware, Gitlab::Webpack::DevServerMiddleware,
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册