From 57f9222b1c55b92210aaa91ddafefaa3b37a2e66 Mon Sep 17 00:00:00 2001 From: Jussi Rantala Date: Tue, 29 Apr 2025 11:33:25 +0300 Subject: [PATCH] fix(rollup-plugin): Fix relative paths on Windows env --- packages/rollup-plugin/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rollup-plugin/src/index.ts b/packages/rollup-plugin/src/index.ts index 66badebcd..3754ddeb4 100644 --- a/packages/rollup-plugin/src/index.ts +++ b/packages/rollup-plugin/src/index.ts @@ -8,7 +8,7 @@ import { virtualCssFileFilter, CompileOptions, } from '@vanilla-extract/integration'; -import { posix } from 'path'; +import { posix, sep } from 'path'; const { relative, normalize, dirname } = posix; @@ -86,7 +86,7 @@ export function vanillaExtractPlugin({ }, // Replace .css import paths with relative paths to emitted css files renderChunk(code, chunkInfo) { - const chunkPath = dirname(chunkInfo.fileName); + const chunkPath = dirname(chunkInfo.fileName.replaceAll(sep, posix.sep)); const output = chunkInfo.imports.reduce((codeResult, importPath) => { const moduleInfo = this.getModuleInfo(importPath); if (!moduleInfo?.meta.assetId) {