Fix(compiler): Fix multi-level dependency path compilation error BUG

This commit is contained in:
2024-10-26 15:44:06 +08:00
parent 887e8089c1
commit 9dff8897f1

View File

@@ -136,7 +136,12 @@ class Compiler {
}
}
const path = importMap.imports[args.path]
let path = importMap.imports[args.path]
let tempPath = args.path
while (!path && tempPath.includes('/')) {
tempPath = tempPath.substring(0, tempPath.lastIndexOf('/'))
path = args.path.replace(tempPath, importMap.imports[tempPath])
}
if (!path) {
throw Error(`Import '${args.path}' not found in Import Map`)