Search code examples
npmsveltesveltekit

svelte.config.js: Unexpected option config.kit.vite


I just started learning Svelte/kit, I stated a small project to learn, I wanted a calendar. I found svelte-calendar package in npm. I installed the package,

npm i svelte-calendar

And I set this in svelte.config.js

import adapter from '@sveltejs/adapter-auto';

const config = {
    kit: {
        adapter: adapter(),

        vite: {
            optimizeDeps: {
                include: ['just-throttle', 'dayjs']
            }
        }
    }
};

export default config;

Why am I getting this error when I run

npm run dev

This is my fist time working with Svelte-kit and npm so I don't have much idea on this.


Solution

  • At some point this was changed, Vite options should be set directly in the regular Vite config file: vite.config.js/.ts

    Docs for optimizeDeps