Skip to content

Commit 4c9f132

Browse files
authored
Stabilize importLocalScripts (#100)
1 parent 39d3e85 commit 4c9f132

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/BlazorWorker/BlazorWorker.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,13 @@ window.BlazorWorker = function () {
209209
const empty = {};
210210

211211
// Import module script from a path relative to approot
212-
self.importLocalScripts = async (urls) => {
212+
self.importLocalScripts = async (...urls) => {
213+
if (urls === undefined || urls === null) {
214+
return;
215+
}
216+
if (!urls.map) {
217+
urls = [urls]
218+
}
213219
const mappedUrls = urls.map(url => initConf.appRoot + (url.startsWith('/') ? '' : '/') + url);
214220
for (const url of mappedUrls) {
215221
await import(url);

0 commit comments

Comments
 (0)