Merge branch '42641-monaco-service-workers-do-not-work-with-cdn-enabled' into 'master'

Resolve "Monaco service workers do not work with CDN enabled"

Closes #42641

See merge request gitlab-org/gitlab-ce!17021
This commit is contained in:
Tim Zallmann 2018-02-16 19:56:28 +00:00
commit 8462e229a2
2 changed files with 10 additions and 0 deletions

View file

@ -6,6 +6,11 @@ monacoContext.require.config({
},
});
// ignore CDN config and use local assets path for service worker which cannot be cross-domain
const relativeRootPath = (gon && gon.relative_url_root) || '';
const monacoPath = `${relativeRootPath}/assets/webpack/monaco-editor/vs`;
window.MonacoEnvironment = { getWorkerUrl: () => `${monacoPath}/base/worker/workerMain.js` };
// eslint-disable-next-line no-underscore-dangle
window.__monaco_context__ = monacoContext;
export default monacoContext.require;

View file

@ -0,0 +1,5 @@
---
title: Fix monaco editor features which were incompatable with GitLab CDN settings
merge_request: 17021
author:
type: fixed