2019-07-31 22:56:46 +05:30
|
|
|
import { joinPaths } from '~/lib/utils/url_utility';
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
/**
|
|
|
|
* Tell webpack to load assets from origin so that web workers don't break
|
|
|
|
* See https://gitlab.com/gitlab-org/gitlab/-/issues/321656 for a fix
|
|
|
|
*/
|
2019-03-02 22:35:43 +05:30
|
|
|
export function resetServiceWorkersPublicPath() {
|
|
|
|
// __webpack_public_path__ is a global variable that can be used to adjust
|
|
|
|
// the webpack publicPath setting at runtime.
|
|
|
|
// see: https://webpack.js.org/guides/public-path/
|
|
|
|
const relativeRootPath = (gon && gon.relative_url_root) || '';
|
2019-07-31 22:56:46 +05:30
|
|
|
const webpackAssetPath = joinPaths(relativeRootPath, '/assets/webpack/');
|
2020-03-13 15:44:24 +05:30
|
|
|
__webpack_public_path__ = webpackAssetPath; // eslint-disable-line babel/camelcase
|
2019-03-02 22:35:43 +05:30
|
|
|
}
|