diff --git a/src/rspack/index.ts b/src/rspack/index.ts index d13cba3..f42a140 100644 --- a/src/rspack/index.ts +++ b/src/rspack/index.ts @@ -32,7 +32,7 @@ export function getRspackPlugin>( apply(compiler) { // We need the prefix of virtual modules to be an absolute path so rspack lets us load them (even if it's made up) // In the loader we strip the made up prefix path again - const VIRTUAL_MODULE_PREFIX = resolve(compiler.options.context ?? process.cwd(), 'node_modules/.virtual', process.pid.toString()) + const VIRTUAL_MODULE_PREFIX = resolve(compiler.options.context ?? process.cwd(), 'node_modules/.virtual', compiler.rspack.experiments.VirtualModulesPlugin ? '' : process.pid.toString()) const meta: UnpluginContextMeta = { framework: 'rspack',