Skip to content

svelte.config.js does not allow vitePlugin section #5888

Description

@tv42

Describe the bug

/** @type {import('@sveltejs/kit').Config} */
const config = {
...
  vitePlugin: {
    experimental: {
      useVitePreprocess: true,
    },
  },
};

leads to Typescript complaining Object literal may only specify known properties, and 'vitePlugin' does not exist in type 'Config'. This change hides the error:

/** @type {import('@sveltejs/kit').Config & {vitePlugin: unknown}} */

Related, the documentation at

```js
// svelte.config.js
export default {
experimental: {
useVitePreprocess: true
}
};
```
is wrong and is missing the vitePlugin level in the config.

Reproduction

sorry

Logs

No response

System Info

System:
    OS: Linux 5.18 NixOS 22.05 (Quokka) 22.05 (Quokka)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 6.65 GB / 62.60 GB
    Container: Yes
    Shell: 5.1.8 - /nix/store/00z6kxv40m8aq9rpf1g1sfgn9mfjvhzd-bash-5.1-p8/bin/bash
  Binaries:
    Node: 16.14.2 - /nix/store/5f0bcmbylg2zizwp96z3976mxnb24jk1-nodejs-16.14.2/bin/node
    npm: 8.5.0 - /nix/store/5f0bcmbylg2zizwp96z3976mxnb24jk1-nodejs-16.14.2/bin/npm
  Browsers:
    Firefox: 103.0.1
  npmPackages:
    @sveltejs/adapter-cloudflare: ^1.0.0-next.31 => 1.0.0-next.31
    @sveltejs/kit: ^1.0.0-next.405 => 1.0.0-next.405
    @sveltejs/vite-plugin-svelte: ^1.0.1 => 1.0.1
    svelte: ^3.49.0 => 3.49.0
    vite: ^3.0.5 => 3.0.5

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.types / typescript

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions