fixed ns imports requiring semicolon (#839)

This commit is contained in:
hydroflame
2021-04-10 02:26:13 -04:00
committed by GitHub
parent 925e96345d
commit 0afdba8f38
2 changed files with 2 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -107,7 +107,7 @@ export function _getScriptUrls(script, scripts, seen) {
// import {foo} from "blob://<uuid>"
//
// Where the blob URL contains the script content.
let transformedCode = script.code.replace(/((?:from|import)\s+(?:'|"))(?:\.\/)?([^'"]+)('|";)/g,
let transformedCode = script.code.replace(/((?:from|import)\s+(?:'|"))(?:\.\/)?([^'"]+)('|")/g,
(unmodified, prefix, filename, suffix) => {
const isAllowedImport = scripts.some(s => s.filename == filename);
if (!isAllowedImport) return unmodified;