concept n1 in category svelte
appears as: n1

This is an excerpt from Manning's book Svelte and Sapper in Action.
There are two ways to enable TypeScript support in a Svelte project. The easiest option is to use npx degit sveltejs/template {project-name} to start a project. Then cd to the directory created and enter node scripts/setupTypeScript.js . This configures the use of svelte-preprocess and a TypeScript plugin for Rollup. It also installs the svelte-check tool and adds a “validate” script in package.json to run it. Finally, it deletes the setupTypeScript.js file and also the scripts directory if there are no other files in it.