Use Typescript in Routify Starter Template.
- This library does not have support for Routify v3 template project (PR Welcome).
- The script name has been changed from
setup-routify-tstoroutify-ts. - This
routify-tsscript designed for Routify Starter Template. Not for Svelte Template. - This documentation is shown for
@sveltech/routifyversion2. For versions below2, please visit v1.0.0. - Please backup your project folder before use
routify-ts convertcommand. You don't need to do that forinitcommand.
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 tonpx @sveltech/routify initcommand. See Routify Get Started.
npx routify-ts init my-routify-approutify-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- Create new
tsconfig.jsonfile in root folder. - Add
svelte-checkscript & somedevDependenciestopackage.json. - Rename
src/main.jstosrc/main.ts. - Add
langproperty toscriptelement insrc/App.svelte. - Add some plugins & configurations to
rollup.config.jsfile. - Create new
extensions.jsonfile in.vscodedirectory.
Tested with @roxi/routify@v2.8.5
- routify-tailwind - Use Tailwind CSS in Routify.
- routify-twind - Use Twind (Tailwind CSS in JS version) in Routify.
- routify-windi - Use Windi CSS (Next generation of Tailwind CSS compiler) in Routify.
- routify-vite Use Vite (Next Generation Frontend Tooling) in Routify.
- routify-carbon - Use IBM Carbon Framework in Routify.