diff --git a/src/extras/module-types.js b/src/extras/module-types.js index 69daaa0b..3f429aa6 100644 --- a/src/extras/module-types.js +++ b/src/extras/module-types.js @@ -8,8 +8,9 @@ import { resolveUrl } from '../common.js'; var systemJSPrototype = global.System.constructor.prototype; var moduleTypesRegEx = /^[^#?]+\.(css|html|json|wasm)([?#].*)?$/; + var _shouldFetch = systemJSPrototype.shouldFetch.bind(systemJSPrototype) systemJSPrototype.shouldFetch = function (url) { - return moduleTypesRegEx.test(url); + return _shouldFetch(url) || moduleTypesRegEx.test(url); }; var jsonContentType = /^application\/json(;|$)/; diff --git a/test/system-node.mjs b/test/system-node.mjs index 3d505d37..2e3f881c 100644 --- a/test/system-node.mjs +++ b/test/system-node.mjs @@ -37,7 +37,7 @@ describe('NodeJS version of SystemJS', () => { describe('import maps', () => { it('can load a module from the network', async () => { - applyImportMap(System, {imports: {"rxjs": "https://unpkg.com/@esm-bundle/rxjs@6.5.4-fix.0/system/rxjs.min.js"}}); + applyImportMap(System, {imports: {"rxjs": "https://cdn.jsdelivr.net/npm/@esm-bundle/rxjs@6.5.4-fix.0/system/rxjs.min.js"}}); const rxjs = await System.import("rxjs"); assert.ok(rxjs.Observable); }); @@ -48,4 +48,4 @@ describe('NodeJS version of SystemJS', () => { assert.equal(foo.p, 5); }); }); -}); \ No newline at end of file +});