Skip to content

Commit

Permalink
fix(rspack): optimize unplugin rspack plugin.__vfsModules id not incl…
Browse files Browse the repository at this point in the history
…udes __virtualModulePrefix (#4300)
  • Loading branch information
thinke5 authored Dec 1, 2024
1 parent 1281ed2 commit e6bbf1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/webpack/src/unplugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function unplugin<Theme extends object>(configOrPath?: WebpackPluginOptio
lastTokenSize = tokens.size
Array.from(plugin.__vfsModules)
.forEach((id) => {
let path = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length))
let path = decodeURIComponent(id.startsWith(plugin.__virtualModulePrefix) ? id.slice(plugin.__virtualModulePrefix.length) : id)
// unplugin changes the id in the `load` hook, follow it
// https://github.com/unjs/unplugin/pull/145/files#diff-2b106437404a793ee5b8f3823344656ce880f698d3d8cb6a7cf785e36fb4bf5cR27
path = normalizeAbsolutePath(path)
Expand Down

0 comments on commit e6bbf1a

Please sign in to comment.