From 5fb07e2093c55dcd01eab1a482c683b8d5c73d59 Mon Sep 17 00:00:00 2001 From: JensLincke Date: Thu, 6 Jun 2024 11:47:28 +0200 Subject: [PATCH] fix amd legacy loading issue SQUASHED: AUTO-COMMIT-src-systemjs-config.js, --- src/systemjs-config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/systemjs-config.js b/src/systemjs-config.js index 391324038..c25628d3a 100644 --- a/src/systemjs-config.js +++ b/src/systemjs-config.js @@ -40,8 +40,12 @@ var cjsExportsRegEx = /(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\. function detectLegacyFormat (source) { if (!source || !source.match) return - if (source.match(amdRegEx)) + + if (source.match(amdRegEx)) { + if (source.match(/\nexport /g)) return // emergency fallback for e.g. codemirror6/external/codemirror.bundle.js return 'amd'; + } + cjsExportsRegEx.lastIndex = 0; cjsRequireRegEx.lastIndex = 0;