"svelte-kit dev" command not creating an index.html file while build

Viewed 1607

I'm trying to create a svelte app using svelte-kit. And I'm having an internal larval server where I'm using the build folder for opening the index.html file.

But the problem is for every time I am doing a change I have to do the svelte-kit build.

And initially, the svelte-kit build also does not create the index.html. So, we configure some adapters to overcome this issue.

I want the same behavior while running the svelte-kit dev also. I don't know what are configurations I needed to change. Currently while I run dev it creates .svelte-kit folder.

// svelte.config.js file
import adapter from '@sveltejs/adapter-static';

const config = {
kit: {
    adapter: adapter(),
    
    // hydrate the <div id="svelte"> element in src/app.html
    target: '#svelte',

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

   },
};

export default config;
0 Answers
Related