File tree 2 files changed +7
-1
lines changed
packages/vite-plugin-svelte/src/utils 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: ensure esm config loading works on windows
Original file line number Diff line number Diff line change 1
1
import path from 'path' ;
2
2
import fs from 'fs' ;
3
+ import { pathToFileURL } from 'url' ;
3
4
import { log } from './log' ;
4
5
import { Options } from './options' ;
5
6
import { ResolvedConfig } from 'vite' ;
@@ -21,7 +22,7 @@ export async function loadSvelteConfig(
21
22
// try to use dynamic import for svelte.config.js first
22
23
if ( configFile . endsWith ( '.js' ) || configFile . endsWith ( '.mjs' ) ) {
23
24
try {
24
- return await dynamicImportDefault ( configFile ) ;
25
+ return await dynamicImportDefault ( pathToFileURL ( configFile ) . href ) ;
25
26
} catch ( e ) {
26
27
log . debug ( `failed to import config ${ configFile } ` , e ) ;
27
28
err = e ;
You can’t perform that action at this time.
0 commit comments