concept n1 in category svelte

appears as: n1
Svelte and Sapper in Action

This is an excerpt from Manning's book Svelte and Sapper in Action.

The following listing shows an example of a component definition that also exports a function from its module context.

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.