Skip to content

Commit b27e2f2

Browse files
committed
docs: remove cjs config documentation, mention ts extensions
1 parent 666dc61 commit b27e2f2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/config.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Besides inline options in Vite config, `vite-plugin-svelte` will also automatica
2323

2424
- `svelte.config.js`
2525
- `svelte.config.mjs`
26-
- `svelte.config.cjs`
26+
- `svelte.config.ts`
27+
- `svelte.config.mts`
2728

2829
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:
2930

@@ -59,10 +60,10 @@ export default {
5960

6061
### Config file extension
6162

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.
6364

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`
6667

6768
> Try to stick with the `.js` extension whenever possible.
6869

0 commit comments

Comments
 (0)