Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a2ba70ec
Commit
a2ba70ec
authored
Feb 14, 2022
by
Rajendra Kadam
Committed by
Luke Duncalfe
Feb 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Proxy webpack dev server in test environment"
This reverts commit
7afca793
.
parent
ea200219
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
app/helpers/webpack_helper.rb
app/helpers/webpack_helper.rb
+10
-2
config/initializers/static_files.rb
config/initializers/static_files.rb
+1
-1
No files found.
app/helpers/webpack_helper.rb
View file @
a2ba70ec
...
@@ -83,9 +83,17 @@ module WebpackHelper
...
@@ -83,9 +83,17 @@ module WebpackHelper
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,
# 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
,
'/'
)
ActionController
::
Base
.
asset_host
.
try
(
:chomp
,
'/'
)
end
end
end
def
webpack_public_path
def
webpack_public_path
relative_path
=
Gitlab
.
config
.
gitlab
.
relative_url_root
relative_path
=
Gitlab
.
config
.
gitlab
.
relative_url_root
...
...
config/initializers/static_files.rb
View file @
a2ba70ec
...
@@ -21,7 +21,7 @@ if app.config.public_file_server.enabled
...
@@ -21,7 +21,7 @@ if app.config.public_file_server.enabled
# 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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment