From 5fe9a460696ca8045ea0f4dfbc10c056707ebb97 Mon Sep 17 00:00:00 2001 From: Julien Elbaz Date: Mon, 13 Oct 2025 20:59:37 +0200 Subject: [PATCH] refactor(rspack): remove pid in virtual path when unnecessary (#549) --- src/rspack/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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',