File tree Expand file tree Collapse file tree 4 files changed +25
-14
lines changed Expand file tree Collapse file tree 4 files changed +25
-14
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @sveltejs/kit ' : patch
3+ ---
4+
5+ [ fix] support vite.config.js on Windows
Original file line number Diff line number Diff line change @@ -4,8 +4,9 @@ import path from 'path';
44import colors from 'kleur' ;
55import sade from 'sade' ;
66import * as vite from 'vite' ;
7- import { load_config } from './core/config/index.js' ;
87import { networkInterfaces , release } from 'os' ;
8+ import { pathToFileURL } from 'url' ;
9+ import { load_config } from './core/config/index.js' ;
910import { coalesce_to_error } from './utils/error.js' ;
1011
1112/** @param {unknown } e */
@@ -289,7 +290,7 @@ export async function get_vite_config(svelte_config) {
289290 for ( const file of [ 'vite.config.js' , 'vite.config.mjs' , 'vite.config.cjs' ] ) {
290291 if ( fs . existsSync ( file ) ) {
291292 // TODO warn here if config.kit.vite was specified
292- const module = await import ( path . resolve ( file ) ) ;
293+ const module = await import ( pathToFileURL ( file ) . toString ( ) ) ;
293294 return {
294295 ...module . default ,
295296 configFile : false
Original file line number Diff line number Diff line change 1- import * as path from 'path' ;
2-
31/** @type {import('@sveltejs/kit').Config } */
42const config = {
53 kit : {
@@ -8,16 +6,6 @@ const config = {
86 } ,
97 serviceWorker : {
108 register : false
11- } ,
12- vite : {
13- server : {
14- // TODO: required to support ipv6, remove on vite 3
15- // https://github.com/vitejs/vite/issues/7075
16- host : 'localhost' ,
17- fs : {
18- allow : [ path . resolve ( '../../../src' ) ]
19- }
20- }
219 }
2210 }
2311} ;
Original file line number Diff line number Diff line change 1+ import * as path from 'path' ;
2+ import { sveltekit } from '@sveltejs/kit/experimental/vite' ;
3+
4+ /** @type {import('vite').UserConfig } */
5+ const config = {
6+ plugins : [ sveltekit ( ) ] ,
7+ server : {
8+ // TODO: required to support ipv6, remove on vite 3
9+ // https://github.com/vitejs/vite/issues/7075
10+ host : 'localhost' ,
11+ fs : {
12+ allow : [ path . resolve ( '../../../src' ) ]
13+ }
14+ }
15+ } ;
16+
17+ export default config ;
You can’t perform that action at this time.
0 commit comments