4
4
5
5
``` js
6
6
export default defineConfig ({
7
- plugins: [
8
- svelte ({
9
- /* plugin options */
10
- })
11
- ]
7
+ plugins: [
8
+ svelte ({
9
+ /* plugin options */
10
+ })
11
+ ]
12
12
});
13
13
```
14
14
@@ -28,11 +28,11 @@ To set a specific config file, use the `configFile` inline option. The path can
28
28
29
29
``` js
30
30
export default defineConfig ({
31
- plugins: [
32
- svelte ({
33
- configFile: ' my-svelte.config.js'
34
- })
35
- ]
31
+ plugins: [
32
+ svelte ({
33
+ configFile: ' my-svelte.config.js'
34
+ })
35
+ ]
36
36
});
37
37
```
38
38
@@ -41,7 +41,7 @@ A basic Svelte config looks like this:
41
41
``` js
42
42
// svelte.config.js
43
43
export default {
44
- // config options
44
+ // config options
45
45
};
46
46
```
47
47
@@ -78,11 +78,11 @@ These options are specific to the Svelte compiler and are generally shared acros
78
78
import sveltePreprocess from ' svelte-preprocess' ;
79
79
80
80
export default defineConfig ({
81
- plugins: [
82
- svelte ({
83
- preprocess: [sveltePreprocess ({ typescript: true })]
84
- })
85
- ]
81
+ plugins: [
82
+ svelte ({
83
+ preprocess: [sveltePreprocess ({ typescript: true })]
84
+ })
85
+ ]
86
86
});
87
87
```
88
88
@@ -126,17 +126,17 @@ A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patt
126
126
127
127
``` js
128
128
export default defineConfig ({
129
- plugins: [
130
- svelte ({
131
- onwarn (warning , defaultHandler ) {
132
- // don't warn on <marquee> elements, cos they're cool
133
- if (warning .code === ' a11y-distracting-elements' ) return ;
134
-
135
- // handle all other warnings normally
136
- defaultHandler (warning);
137
- }
138
- })
139
- ]
129
+ plugins: [
130
+ svelte ({
131
+ onwarn (warning , defaultHandler ) {
132
+ // don't warn on <marquee> elements, cos they're cool
133
+ if (warning .code === ' a11y-distracting-elements' ) return ;
134
+
135
+ // handle all other warnings normally
136
+ defaultHandler (warning);
137
+ }
138
+ })
139
+ ]
140
140
});
141
141
```
142
142
@@ -176,13 +176,13 @@ These options are considered experimental and breaking changes to them can occur
176
176
177
177
``` js
178
178
export default defineConfig ({
179
- plugins: [
180
- svelte ({
181
- experimental: {
182
- // experimental options
183
- }
184
- })
185
- ]
179
+ plugins: [
180
+ svelte ({
181
+ experimental: {
182
+ // experimental options
183
+ }
184
+ })
185
+ ]
186
186
});
187
187
```
188
188
@@ -213,9 +213,9 @@ export default defineConfig({
213
213
214
214
``` ts
215
215
type DynamicCompileOptions = (data : {
216
- filename: string ; // The file to be compiled
217
- code: string ; // The preprocessed Svelte code
218
- compileOptions: Partial <CompileOptions >; // The current compiler options
216
+ filename: string ; // The file to be compiled
217
+ code: string ; // The preprocessed Svelte code
218
+ compileOptions: Partial <CompileOptions >; // The current compiler options
219
219
}) => Promise <Partial <CompileOptions > | void > | Partial <CompileOptions > | void ;
220
220
```
221
221
@@ -225,17 +225,17 @@ export default defineConfig({
225
225
226
226
``` js
227
227
export default defineConfig ({
228
- plugins: [
229
- svelte ({
230
- experimental: {
231
- dynamicCompileOptions ({ filename, compileOptions }) {
232
- // Dynamically set hydration per Svelte file
233
- if (compileWithHydratable (filename) && ! compileOptions .hydratable ) {
234
- return { hydratable: true };
235
- }
236
- }
237
- }
238
- })
239
- ]
228
+ plugins: [
229
+ svelte ({
230
+ experimental: {
231
+ dynamicCompileOptions ({ filename, compileOptions }) {
232
+ // Dynamically set hydration per Svelte file
233
+ if (compileWithHydratable (filename) && ! compileOptions .hydratable ) {
234
+ return { hydratable: true };
235
+ }
236
+ }
237
+ }
238
+ })
239
+ ]
240
240
});
241
241
```
0 commit comments