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
0
Merge Requests
0
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
Boxiang Sun
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+8
-0
config/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';
...
@@ -164,6 +164,14 @@ import './visibility_select';
import
'
./wikis
'
;
import
'
./wikis
'
;
import
'
./zen_mode
'
;
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
// eslint-disable-next-line global-require, import/no-commonjs
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
require
(
'
./test_utils/
'
);
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
require
(
'
./test_utils/
'
);
...
...
config/webpack.config.js
View file @
3f3993c3
...
@@ -244,7 +244,6 @@ if (IS_DEV_SERVER) {
...
@@ -244,7 +244,6 @@ if (IS_DEV_SERVER) {
hot
:
DEV_SERVER_LIVERELOAD
,
hot
:
DEV_SERVER_LIVERELOAD
,
inline
:
DEV_SERVER_LIVERELOAD
inline
:
DEV_SERVER_LIVERELOAD
};
};
config
.
output
.
publicPath
=
'
//
'
+
DEV_SERVER_HOST
+
'
:
'
+
DEV_SERVER_PORT
+
config
.
output
.
publicPath
;
config
.
plugins
.
push
(
config
.
plugins
.
push
(
// watch node_modules for changes if we encounter a missing module compile error
// watch node_modules for changes if we encounter a missing module compile error
new
WatchMissingNodeModulesPlugin
(
path
.
join
(
ROOT_PATH
,
'
node_modules
'
))
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