You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/config.md
+23-7Lines changed: 23 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ A basic Svelte config looks like this:
44
44
```js
45
45
// svelte.config.js
46
46
exportdefault {
47
-
//svelte options
47
+
//Svelte options
48
48
extensions: ['.svelte'],
49
49
compilerOptions: {},
50
50
preprocess: [],
@@ -60,7 +60,7 @@ export default {
60
60
61
61
### Config file extension
62
62
63
-
The content of svelte config should always be in esm syntax. Depending on Node's mode, make sure you're using the correct extension.
63
+
The content of Svelte config should always be in esm syntax. Depending on Node's mode, make sure you're using the correct extension.
64
64
65
65
- If `type: "module"` is defined in `package.json`, prefer `.js` or `.ts`
66
66
- If `type: "module"` is not defined, use `.mjs` or `.mts`
@@ -77,7 +77,7 @@ export default defineConfig({
77
77
plugins: [
78
78
svelte({
79
79
configFile:false
80
-
// your svelte config here
80
+
// your Svelte config here
81
81
})
82
82
]
83
83
});
@@ -158,12 +158,14 @@ These options are specific to the Vite plugin itself.
158
158
### include
159
159
160
160
-**Type:**`string | string[]`
161
+
-**Default:** unset
161
162
162
-
A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files the plugin should operate on. By default, all svelte files are included.
163
+
A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files the plugin should operate on**in addition** to the files ending with one of the configured extensions.
163
164
164
165
### exclude
165
166
166
167
-**Type:**`string | string[]`
168
+
-**Default:** unset
167
169
168
170
A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files to be ignored by the plugin. By default, no files are ignored.
169
171
@@ -216,7 +218,7 @@ A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patt
216
218
-**Type:**`InspectorOptions | boolean`
217
219
-**Default:**`unset` for dev, always `false` for build
218
220
219
-
Set to `true` or options object to enable svelte inspector during development. See the [inspector docs](./inspector.md) for the full configuration options.
221
+
Set to `true` or options object to enable Svelte inspector during development. See the [inspector docs](./inspector.md) for the full configuration options.
220
222
221
223
Inspector mode shows you the file location where the element under cursor is defined and you can click to quickly open your code editor at this location.
222
224
@@ -309,7 +311,7 @@ export default {
309
311
normalizedFilename: string;
310
312
timestamp: number;
311
313
warnings: Warning[]; // allWarnings filtered by warnings where onwarn did not call the default handler
312
-
allWarnings: Warning[]; // includes warnings filtered by onwarn and our extra vitepluginsvelte warnings
314
+
allWarnings: Warning[]; // includes warnings filtered by onwarn and our extra vite-plugin-svelte warnings
313
315
rawWarnings: Warning[]; // raw compiler output
314
316
};
315
317
```
@@ -319,4 +321,18 @@ export default {
319
321
-**Type**`boolean`
320
322
-**Default:**`false`
321
323
322
-
disable svelte resolve warnings. Note:this is highly discouraged and you should instead fix these packages which will breakin the future.
324
+
disable Svelte resolve warnings. Note:this is highly discouraged and you should instead fix these packages which will breakin the future.
325
+
326
+
### disableApiSveltePreprocessWarnings
327
+
328
+
-**Type**`boolean`
329
+
-**Default:**`false`
330
+
331
+
disable api.sveltePreprocess deprecation warnings
332
+
333
+
### compileModule
334
+
335
+
-**Type**`CompileModuleOptions`
336
+
-**Default:**`undefined`
337
+
338
+
set custom compile options for compilation Svelte modules (`.svelte.js` files).
0 commit comments