Skip to content

Commit 6b0a42a

Browse files
committed
fix(cli): normalize for windows
1 parent e9ca883 commit 6b0a42a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/cli/src/pack-bin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ function externalDtsTypeOnlyPlugin() {
3737
name: 'vite-plus:external-dts-type-only',
3838
transform: {
3939
filter: { id: { include: [EXTERNAL_DTS_FIX_RE] } },
40-
handler(code: string, id: string) {
40+
handler(code: string, rawId: string) {
41+
// Normalize Windows backslash paths to forward slashes for regex matching
42+
const id = rawId.replaceAll('\\', '/');
4143
if (EXTERNAL_DTS_INTERNAL_RE.test(id)) {
4244
// postcss/lightningcss internal files: transform imports only
4345
// (exports may include value re-exports like `export const Features`)

0 commit comments

Comments
 (0)