diff --git a/packages/plugin-legacy/index.js b/packages/plugin-legacy/index.js index bfa6ee491bcbf6..2267cd9cf82b42 100644 --- a/packages/plugin-legacy/index.js +++ b/packages/plugin-legacy/index.js @@ -596,7 +596,7 @@ async function buildPolyfillChunk( bundle[polyfillChunk.name] = polyfillChunk } -const polyfillId = 'vite/legacy-polyfills' +const polyfillId = '\0vite/legacy-polyfills' /** * @param {Set} imports diff --git a/packages/vite/src/node/build.ts b/packages/vite/src/node/build.ts index 47cfd062a7c0bd..3896392e58bdfb 100644 --- a/packages/vite/src/node/build.ts +++ b/packages/vite/src/node/build.ts @@ -269,7 +269,7 @@ export function resolveBuildOptions(root: string, raw?: BuildOptions): ResolvedB } } - const resolve = (p: string) => path.resolve(root, p) + const resolve = (p: string) => p.startsWith('\0') ? p : path.resolve(root, p) resolved.outDir = resolve(resolved.outDir)