Commit 8462e229 authored by Tim Zallmann's avatar Tim Zallmann

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
parents 306e0d16 b49d5dd1
...@@ -6,6 +6,11 @@ monacoContext.require.config({ ...@@ -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 // eslint-disable-next-line no-underscore-dangle
window.__monaco_context__ = monacoContext; window.__monaco_context__ = monacoContext;
export default monacoContext.require; export default monacoContext.require;
---
title: Fix monaco editor features which were incompatable with GitLab CDN settings
merge_request: 17021
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment