BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3f3993c3
Commit
3f3993c3
authored
Jun 14, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamically set webpack publicPath when relative_url_root enabled
parent
b3792323
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
main.js
app/assets/javascripts/main.js
+8
-0
webpack.config.js
config/webpack.config.js
+0
-1
No files found.
app/assets/javascripts/main.js
View file @
3f3993c3
...
...
@@ -164,6 +164,14 @@ import './visibility_select';
import
'./wikis'
;
import
'./zen_mode'
;
// set url root for webpack async chunks (assumes config.output.publicPath is an absolute path)
if
(
gon
&&
gon
.
relative_url_root
)
{
const
basePath
=
gon
.
relative_url_root
.
replace
(
/
\/
$/
,
''
);
// eslint-disable-next-line camelcase, no-undef
__webpack_public_path__
=
basePath
+
__webpack_public_path__
;
}
// eslint-disable-next-line global-require, import/no-commonjs
if
(
process
.
env
.
NODE_ENV
!==
'production'
)
require
(
'./test_utils/'
);
...
...
config/webpack.config.js
View file @
3f3993c3
...
...
@@ -244,7 +244,6 @@ if (IS_DEV_SERVER) {
hot
:
DEV_SERVER_LIVERELOAD
,
inline
:
DEV_SERVER_LIVERELOAD
};
config
.
output
.
publicPath
=
'//'
+
DEV_SERVER_HOST
+
':'
+
DEV_SERVER_PORT
+
config
.
output
.
publicPath
;
config
.
plugins
.
push
(
// watch node_modules for changes if we encounter a missing module compile error
new
WatchMissingNodeModulesPlugin
(
path
.
join
(
ROOT_PATH
,
'node_modules'
))
...
...
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