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: ensure esm config loading works on windows
Original file line number Diff line number Diff line change 11import path from 'path' ;
22import fs from 'fs' ;
3+ import { pathToFileURL } from 'url' ;
34import { log } from './log' ;
45import { Options } from './options' ;
56import { ResolvedConfig } from 'vite' ;
@@ -21,7 +22,7 @@ export async function loadSvelteConfig(
2122 // try to use dynamic import for svelte.config.js first
2223 if ( configFile . endsWith ( '.js' ) || configFile . endsWith ( '.mjs' ) ) {
2324 try {
24- return await dynamicImportDefault ( configFile ) ;
25+ return await dynamicImportDefault ( pathToFileURL ( configFile ) . href ) ;
2526 } catch ( e ) {
2627 log . debug ( `failed to import config ${ configFile } ` , e ) ;
2728 err = e ;
You can’t perform that action at this time.
0 commit comments