Skip to content
4 changes: 2 additions & 2 deletions packages/rollup-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
virtualCssFileFilter,
type CompileOptions,
} from '@vanilla-extract/integration';
import { posix } from 'path';
import { posix, sep } from 'path';

const { relative, normalize, dirname } = posix;

Expand Down Expand Up @@ -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) {
Expand Down