fix: import path
This commit is contained in:
parent
783d8d70d8
commit
2d1e742142
|
|
@ -183,8 +183,8 @@ export function transformIndexFile(id: string, content: string, templateDir: str
|
|||
lines.push(registerSource);
|
||||
|
||||
for (const value of importInfos.values()) {
|
||||
const importPath = resolveHook(value.filename, value.importSource);
|
||||
lines.push(`const ${value.id} = () => import('${importPath?.replaceAll(path.sep, '/')}').then((mod) => mod.${value.remoteName || 'default'});`);
|
||||
const importPath = resolveHook(value.filename, value.importSource) ?? value.importSource;
|
||||
lines.push(`const ${value.id} = () => import('${importPath.replaceAll(path.sep, '/')}').then((mod) => mod.${value.remoteName || 'default'});`);
|
||||
}
|
||||
|
||||
lines.push(`__pwRegistry.initialize({ ${[...importInfos.keys()].join(',\n ')} });`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue