File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
packages/vite-plugin-svelte/src/utils Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @sveltejs/vite-plugin-svelte ' : patch
3
+ ---
4
+
5
+ fix(resolve): normalize path resolved from "svelte" field to ensure consistency across operating systems
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import path from 'path';
2
2
import { builtinModules } from 'module' ;
3
3
import { resolveDependencyData , isCommonDepWithoutSvelteField } from './dependencies' ;
4
4
import { VitePluginSvelteCache } from './vite-plugin-svelte-cache' ;
5
+ import { normalizePath } from 'vite' ;
5
6
6
7
export async function resolveViaPackageJsonSvelte (
7
8
importee : string ,
@@ -22,7 +23,7 @@ export async function resolveViaPackageJsonSvelte(
22
23
if ( pkgData ) {
23
24
const { pkg, dir } = pkgData ;
24
25
if ( pkg . svelte ) {
25
- const result = path . resolve ( dir , pkg . svelte ) ;
26
+ const result = normalizePath ( path . resolve ( dir , pkg . svelte ) ) ;
26
27
cache . setResolvedSvelteField ( importee , importer , result ) ;
27
28
return result ;
28
29
}
You can’t perform that action at this time.
0 commit comments