Skip to content

Commit

Permalink
fix amd legacy loading issue
Browse files Browse the repository at this point in the history
SQUASHED: AUTO-COMMIT-src-systemjs-config.js,
  • Loading branch information
JensLincke committed Jun 6, 2024
1 parent 00633f9 commit 5fb07e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/systemjs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5fb07e2

Please sign in to comment.