44
55``` js
66export default defineConfig ({
7- plugins: [
8- svelte ({
9- /* plugin options */
10- })
11- ]
7+ plugins: [
8+ svelte ({
9+ /* plugin options */
10+ })
11+ ]
1212});
1313```
1414
@@ -28,11 +28,11 @@ To set a specific config file, use the `configFile` inline option. The path can
2828
2929``` js
3030export 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+ ]
3636});
3737```
3838
@@ -41,7 +41,7 @@ A basic Svelte config looks like this:
4141``` js
4242// svelte.config.js
4343export default {
44- // config options
44+ // config options
4545};
4646```
4747
@@ -78,11 +78,11 @@ These options are specific to the Svelte compiler and are generally shared acros
7878 import sveltePreprocess from ' svelte-preprocess' ;
7979
8080 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+ ]
8686 });
8787 ```
8888
@@ -126,17 +126,17 @@ A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patt
126126
127127 ``` js
128128 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+ ]
140140 });
141141 ```
142142
@@ -176,13 +176,13 @@ These options are considered experimental and breaking changes to them can occur
176176
177177``` js
178178export 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+ ]
186186});
187187```
188188
@@ -213,9 +213,9 @@ export default defineConfig({
213213
214214 ``` ts
215215 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
219219 }) => Promise <Partial <CompileOptions > | void > | Partial <CompileOptions > | void ;
220220 ```
221221
@@ -225,17 +225,17 @@ export default defineConfig({
225225
226226 ``` js
227227 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+ ]
240240 });
241241 ```
0 commit comments