Merge branch 'fix-webpack-assets-relative-url-bug' into 'master'

Fix webpack asset patch with '/' as relative root

See merge request gitlab-org/gitlab-ce!27909
This commit is contained in:
Phil Hughes 2019-05-01 09:42:00 +00:00
commit b4ede51274
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,5 @@
import { joinPaths } from '~/lib/utils/url_utility';
// tell webpack to load assets from origin so that web workers don't break
// eslint-disable-next-line import/prefer-default-export
export function resetServiceWorkersPublicPath() {
@ -5,7 +7,7 @@ export function resetServiceWorkersPublicPath() {
// the webpack publicPath setting at runtime.
// see: https://webpack.js.org/guides/public-path/
const relativeRootPath = (gon && gon.relative_url_root) || '';
const webpackAssetPath = `${relativeRootPath}/assets/webpack/`;
const webpackAssetPath = joinPaths(relativeRootPath, '/assets/webpack/');
__webpack_public_path__ = webpackAssetPath; // eslint-disable-line camelcase
// monaco-editor-webpack-plugin currently (incorrectly) references the

View File

@ -0,0 +1,5 @@
---
title: Fix webpack assets handling when relative url root is '/'
merge_request: 27909
author:
type: fixed