Skip to content

Commit

Permalink
Stabilize importLocalScripts (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tewr authored Feb 24, 2024
1 parent 39d3e85 commit 4c9f132
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/BlazorWorker/BlazorWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,13 @@ window.BlazorWorker = function () {
const empty = {};

// Import module script from a path relative to approot
self.importLocalScripts = async (urls) => {
self.importLocalScripts = async (...urls) => {
if (urls === undefined || urls === null) {
return;
}
if (!urls.map) {
urls = [urls]
}
const mappedUrls = urls.map(url => initConf.appRoot + (url.startsWith('/') ? '' : '/') + url);
for (const url of mappedUrls) {
await import(url);
Expand Down

0 comments on commit 4c9f132

Please sign in to comment.