diff --git a/src/components/Playground/compiler.ts b/src/components/Playground/compiler.ts index 3502f8c..6d7a5a7 100644 --- a/src/components/Playground/compiler.ts +++ b/src/components/Playground/compiler.ts @@ -135,7 +135,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`)