Search code examples
typescriptvitesveltesveltekit

What does `svelte-kit sync` do?


I've checked the svelte-kit sync docs and the discussion around it and even tried searching Stack Overflow and asking AI.

My understanding is it generates tsconfig.json and is for setting up the project with typescript. When I delete my tsconfig.json and run it, nothing seems to happen.


Solution

  • It creates the TS files for the generated types for load functions and actions that allow you to have strongly typed data transfer to the page properties data and form.

    There are two tsconfig.json files, one is generated, the other is not.
    Only the one within the .svelte-kit directory is generated.

    All these files are also created/updated by the dev server. The sync command is helpful for running separate builds.