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
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,8 @@ Besides inline options in Vite config, `vite-plugin-svelte` will also automatica
23
23
24
24
-`svelte.config.js`
25
25
-`svelte.config.mjs`
26
-
-`svelte.config.cjs`
26
+
-`svelte.config.ts`
27
+
-`svelte.config.mts`
27
28
28
29
To set a specific config file, use the `configFile` inline option. The path can be absolute or relative to the [Vite root](https://vitejs.dev/config/#root). For example:
29
30
@@ -59,10 +60,10 @@ export default {
59
60
60
61
### Config file extension
61
62
62
-
Depending on Node's mode, make sure you're using the correct extension and syntax so it can be resolved safely.
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
64
64
-
- If `type: "module"` is defined in `package.json`, using`.js`only allows ESM code. Use `.cjs` to allow CJS code.
65
-
- If `type: "module"` is not defined, using`.js` only allows CJS code. Use `.mjs` to allows ESM code.
65
+
- If `type: "module"` is defined in `package.json`, prefer`.js`or `.ts`
66
+
- If `type: "module"` is not defined, use`.mjs` or `.mts`
66
67
67
68
> Try to stick with the `.js` extension whenever possible.
0 commit comments