@@ -71,7 +71,10 @@ export function svelte(inlineOptions?: Partial<Options>): Plugin {
71
71
setupWatchers ( options , cache , requestParser ) ;
72
72
} ,
73
73
74
- load ( id , ssr ) {
74
+ load ( id , opts ) {
75
+ // @ts -expect-error anticipate vite changing second parameter as options object
76
+ // see https://github.com/vitejs/vite/discussions/5109
77
+ const ssr : boolean = opts === true || opts ?. ssr ;
75
78
const svelteRequest = requestParser ( id , ! ! ssr ) ;
76
79
if ( svelteRequest ) {
77
80
const { filename, query } = svelteRequest ;
@@ -91,7 +94,10 @@ export function svelte(inlineOptions?: Partial<Options>): Plugin {
91
94
}
92
95
} ,
93
96
94
- async resolveId ( importee , importer , customOptions , ssr ) {
97
+ async resolveId ( importee , importer , opts , _ssr ) {
98
+ // @ts -expect-error anticipate vite changing second parameter as options object
99
+ // see https://github.com/vitejs/vite/discussions/5109
100
+ const ssr : boolean = _ssr === true || opts . ssr ;
95
101
const svelteRequest = requestParser ( importee , ! ! ssr ) ;
96
102
if ( svelteRequest ?. query . svelte ) {
97
103
if ( svelteRequest . query . type === 'style' ) {
@@ -142,7 +148,10 @@ export function svelte(inlineOptions?: Partial<Options>): Plugin {
142
148
}
143
149
} ,
144
150
145
- async transform ( code , id , ssr ) {
151
+ async transform ( code , id , opts ) {
152
+ // @ts -expect-error anticipate vite changing second parameter as options object
153
+ // see https://github.com/vitejs/vite/discussions/5109
154
+ const ssr : boolean = opts === true || opts ?. ssr ;
146
155
const svelteRequest = requestParser ( id , ! ! ssr ) ;
147
156
if ( ! svelteRequest ) {
148
157
return ;
0 commit comments