Commit ec654bc4 authored by Paul Slaughter's avatar Paul Slaughter

Fix webpack asset patch with '/' as relative root

https://gitlab.com/gitlab-org/gitlab-ce/issues/60932
parent 2432a540
import { joinPaths } from '~/lib/utils/url_utility';
// tell webpack to load assets from origin so that web workers don't break // tell webpack to load assets from origin so that web workers don't break
// eslint-disable-next-line import/prefer-default-export // eslint-disable-next-line import/prefer-default-export
export function resetServiceWorkersPublicPath() { export function resetServiceWorkersPublicPath() {
...@@ -5,7 +7,7 @@ export function resetServiceWorkersPublicPath() { ...@@ -5,7 +7,7 @@ export function resetServiceWorkersPublicPath() {
// the webpack publicPath setting at runtime. // the webpack publicPath setting at runtime.
// see: https://webpack.js.org/guides/public-path/ // see: https://webpack.js.org/guides/public-path/
const relativeRootPath = (gon && gon.relative_url_root) || ''; 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 __webpack_public_path__ = webpackAssetPath; // eslint-disable-line camelcase
// monaco-editor-webpack-plugin currently (incorrectly) references the // monaco-editor-webpack-plugin currently (incorrectly) references the
......
---
title: Fix webpack assets handling when relative url root is '/'
merge_request: 27909
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment