We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 50b76f8 commit 7a7f908Copy full SHA for 7a7f908
packages/vite-plugin-svelte/src/utils/loadSvelteConfig.ts
@@ -1,5 +1,6 @@
1
import path from 'path';
2
import fs from 'fs';
3
+import { pathToFileURL } from 'url';
4
import { log } from './log';
5
import { Options } from './options';
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
23
if (configFile.endsWith('.js') || configFile.endsWith('.mjs')) {
24
try {
- return await dynamicImportDefault(configFile);
25
+ return await dynamicImportDefault(pathToFileURL(configFile).href);
26
} catch (e) {
27
log.debug(`failed to import config ${configFile}`, e);
28
err = e;
0 commit comments