Skip to content

Commit

Permalink
avoid module-types override shouldFetch
Browse files Browse the repository at this point in the history
  • Loading branch information
wenerme committed Sep 23, 2022
1 parent d44d41f commit 2107260
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/extras/module-types.js
Expand Up @@ -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(;|$)/;
Expand Down
4 changes: 2 additions & 2 deletions test/system-node.mjs
Expand Up @@ -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);
});
Expand All @@ -48,4 +48,4 @@ describe('NodeJS version of SystemJS', () => {
assert.equal(foo.p, 5);
});
});
});
});

0 comments on commit 2107260

Please sign in to comment.