Skip to content

Commit

Permalink
Adding importmap js property to script elements. Resolves #1939.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldenning committed Jul 6, 2019
1 parent e6775c4 commit db11367
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/features/import-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ systemJSPrototype.resolve = function (id, parentUrl) {
importMapPromise = importMapPromise.then(function (map) {
return (script._j || script.src && fetch(script.src).then(function (resp) {return resp.json()}) || Promise.resolve(JSON.parse(script.innerHTML)))
.then(function (json) {
return mergeImportMap(map, parseImportMap(json, script.src || baseUrl));
const scriptMap = parseImportMap(json, script.src || baseUrl);
script.importmap = scriptMap;
return mergeImportMap(map, scriptMap);
});
});
});
Expand Down

0 comments on commit db11367

Please sign in to comment.