diff options
author | Phil Hughes <me@iamphill.com> | 2019-02-08 14:06:24 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-02-08 14:06:24 +0000 |
commit | 37b860d7bf24bfe5c6414bcd4009ce85a1cafd46 (patch) | |
tree | a65e3a315319df4beef5d974608441a7ca2853df /app/assets/javascripts/lib/utils/webpack.js | |
parent | d32331516ed7c6a7ccfe82f2529e450fd829bb94 (diff) | |
download | gitlab-ce-37b860d7bf24bfe5c6414bcd4009ce85a1cafd46.tar.gz |
Fixes diff web worker not loading in staging
https://gitlab.com/gitlab-org/quality/staging/issues/34
Diffstat (limited to 'app/assets/javascripts/lib/utils/webpack.js')
-rw-r--r-- | app/assets/javascripts/lib/utils/webpack.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/webpack.js b/app/assets/javascripts/lib/utils/webpack.js new file mode 100644 index 00000000000..308ad9784e4 --- /dev/null +++ b/app/assets/javascripts/lib/utils/webpack.js @@ -0,0 +1,10 @@ +// 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() { + // __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) || ''; + const webpackAssetPath = `${relativeRootPath}/assets/webpack/`; + __webpack_public_path__ = webpackAssetPath; // eslint-disable-line camelcase +} |