Svelte + Typescript + Storybook SSR Boilerplate
October 28, 2019 ยท View on GitHub
This repo was developed when Svelte 3 first came out. Since then better svelte-typescript integration has been developed, such as this one
=========
Svelte + Typescript + Storybook SSR Boilerplate
This is a Svelte + Typescript + Storybook SSR boiletplate project. If you are intrested in developing only UI components or SPA, it is here.
Creating Pages / Routes
-
Create a
.htmlfile and a corresponding.tsfile for the svelte component. During build time, the.tswill be combined with the.htmlfile to become a svelte component..html&.tsmust have the same filename. -
Subroutes is created by subfolder. It also assumes
/Indexas/. For example,pages/member/Index.htmlwill create a routehttp://localhost/member/ -
Every page has its own client side javascript to be used during hydration. This client side JS will load the minimum required svelte component.
How does the build process works?
- Compile typescript and put it
buildfolder, - Combine svelte html & svelte js (generated from typescript) together
- Generated the list of entry files to be used by webpack for client side hydration
- Profit!
TODO
- Add service-worker
- Add Purify CSS
- Add Brotli compression