Skip to content

Commit

Permalink
fix(plugin): handle // in chunk file names
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 16, 2024
1 parent 7852aa2 commit eefa78c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ const unplugin = createUnplugin<UnwasmPluginOptions>((opts) => {
if (!asset) {
return;
}
const nestedLevel = chunk.fileName.split("/").length - 1;
const nestedLevel =
chunk.fileName.split("/").filter(Boolean /* handle // */).length - 1;
const relativeId =
(nestedLevel ? "../".repeat(nestedLevel) : "./") + asset.name;
return {
Expand Down

0 comments on commit eefa78c

Please sign in to comment.