mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 14:59:16 +02:00
fixed ns imports requiring semicolon (#839)
This commit is contained in:
2
dist/engine.bundle.js
vendored
2
dist/engine.bundle.js
vendored
File diff suppressed because one or more lines are too long
@@ -107,7 +107,7 @@ export function _getScriptUrls(script, scripts, seen) {
|
|||||||
// import {foo} from "blob://<uuid>"
|
// import {foo} from "blob://<uuid>"
|
||||||
//
|
//
|
||||||
// Where the blob URL contains the script content.
|
// 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) => {
|
(unmodified, prefix, filename, suffix) => {
|
||||||
const isAllowedImport = scripts.some(s => s.filename == filename);
|
const isAllowedImport = scripts.some(s => s.filename == filename);
|
||||||
if (!isAllowedImport) return unmodified;
|
if (!isAllowedImport) return unmodified;
|
||||||
|
|||||||
Reference in New Issue
Block a user