Use Typescript in Routify Starter Template.
setup-routify-ts
to routify-ts
.routify-ts
script designed for Routify Starter Template. Not for Svelte Template.@sveltech/routify
version 2
. For versions below 2
, please visit v1.0.0.routify-ts convert
command. You don't need to do that for init
command.We have 2 methods to add Typescript support to Routify Starter Template. You can choose whichever one suits your needs.
Support methods:
With this method, routify-ts
will create a Routify Starter Template and then add additional configurations for Typescript purposes.
npx routify-ts init <project-name> [routify-init-args]
project-name
: Your project name (will be used as the folder name).routify-init-args
: Some arguments will be passed to npx @sveltech/routify init
command. See Routify Get Started.npx routify-ts init my-routify-app
routify-ts
will add additional configurations for Typescript needs to an existing project.
Important - Try to do backups to prevent conflicts in case of conflicts with the configuration that you have made.
npx routify-ts convert [project-directory]
project-directory
: Path to your project folder. Default: .
(Current folder).npx routify-ts convert /home/me/my-routify-app
tsconfig.json
file in root folder.svelte-check
script & some devDependencies
to package.json
.src/main.js
to src/main.ts
.lang
property to script
element in src/App.svelte
.rollup.config.js
file.extensions.json
file in .vscode
directory.Tested with @roxi/[email protected]