Skip to content

Commit 7a7f908

Browse files
committed
fix: use pathToFileURL to ensure windows compatibility
see #29 (comment)
1 parent 50b76f8 commit 7a7f908

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/vite-plugin-svelte/src/utils/loadSvelteConfig.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from 'path';
22
import fs from 'fs';
3+
import { pathToFileURL } from 'url';
34
import { log } from './log';
45
import { Options } from './options';
56
import { 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;

0 commit comments

Comments
 (0)