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:
commit
8462e229a2
2 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Fix monaco editor features which were incompatable with GitLab CDN settings
|
||||
merge_request: 17021
|
||||
author:
|
||||
type: fixed
|
Loading…
Reference in a new issue