diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-05-03 11:16:56 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-05-03 11:56:34 -0500 |
commit | eb548e6eb14907e1d362a2e47e81498195a74183 (patch) | |
tree | 3dffd86c9b842aaf8cd3a1c5fcf2068134736ab1 /app/assets/javascripts/ide/index.js | |
parent | b2d90ea1fb16ec4db441c86262191a093401b962 (diff) | |
download | gitlab-ce-eb548e6eb14907e1d362a2e47e81498195a74183.tar.gz |
adjust IDE page loading config to ensure web workers are not loaded cross-origin
Diffstat (limited to 'app/assets/javascripts/ide/index.js')
-rw-r--r-- | app/assets/javascripts/ide/index.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/assets/javascripts/ide/index.js b/app/assets/javascripts/ide/index.js index cbfb3dc54f2..1119b572a1f 100644 --- a/app/assets/javascripts/ide/index.js +++ b/app/assets/javascripts/ide/index.js @@ -4,7 +4,9 @@ import ide from './components/ide.vue'; import store from './stores'; import router from './ide_router'; -function initIde(el) { +Vue.use(Translate); + +export function initIde(el) { if (!el) return null; return new Vue({ @@ -26,8 +28,9 @@ function initIde(el) { }); } -const ideElement = document.getElementById('ide'); - -Vue.use(Translate); - -initIde(ideElement); +export function resetServiceWorkersPublicPath() { + // tell webpack to load assets from origin so that web workers don't break + const relativeRootPath = (gon && gon.relative_url_root) || ''; + const webpackAssetPath = `${relativeRootPath}/assets/webpack/`; + __webpack_public_path__ = webpackAssetPath; // eslint-disable-line camelcase +} |