fix monaco editor config to ensure service workers are not loaded from cross-domain origins
This commit is contained in:
parent
4342e3915c
commit
e5c8a47cbb
1 changed files with 5 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;
|
||||
|
|
Loading…
Reference in a new issue