Skip to content

Commit

Permalink
fix(webpack): avoid repeat set __vfsModules value (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickChen928 authored Aug 18, 2022
1 parent f647af7 commit de5af69
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/webpack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,11 @@ export function getWebpackPlugin<UserOptions = {}> (
)

// webpack virtual module should pass in the correct path
plugin.__vfs!.writeModule(resolved, '')
plugin.__vfsModules!.add(resolved)
// https://github.com/unjs/unplugin/pull/155
if (!plugin.__vfsModules!.has(resolved)) {
plugin.__vfs!.writeModule(resolved, '')
plugin.__vfsModules!.add(resolved)
}
}

// construct the new request
Expand Down

0 comments on commit de5af69

Please sign in to comment.