FIX: Load highlightjs bundle via CDN (#24335)

This commit is contained in:
David Taylor 2023-11-10 22:19:06 +00:00 committed by GitHub
parent 0878dde213
commit cdbe0f74e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import DEBUG from "@glimmer/env";
import { waitForPromise } from "@ember/test-waiters";
import mergeHTMLPlugin from "discourse/lib/highlight-syntax-merge-html-plugin";
import { isTesting } from "discourse-common/config/environment";
import { getURLWithCDN } from "discourse-common/lib/get-url";
let _moreLanguages = [];
let _plugins = [];
@ -99,7 +100,8 @@ async function loadLanguageInitializer(langFile) {
}
// Load site-specific language bundle generated by Rails HighlightJsController
const module = await import(/* webpackIgnore: true */ langFile);
const url = getURLWithCDN(langFile);
const module = await import(/* webpackIgnore: true */ url);
return module.default;
}