Skip to content

Commit

Permalink
Merge branch '42641-monaco-service-workers-do-not-work-with-cdn-enabl…
Browse files Browse the repository at this point in the history
…ed' into 'master'

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

Closes #42641

See merge request gitlab-org/gitlab-ce!17021
  • Loading branch information
Tim Zallmann committed Feb 16, 2018
2 parents 306e0d1 + b49d5dd commit 8462e22
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/assets/javascripts/ide/monaco_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Fix monaco editor features which were incompatable with GitLab CDN settings
merge_request: 17021
author:
type: fixed

0 comments on commit 8462e22

Please sign in to comment.