I recently started a new project and decided to go with Snowpack, Typescript and Svelte. There is no many tutorials or examples how to do the complete setup, so after I made it work for myself I decided to share my findings as create app template. I hope it maybe useful and will save someone some time.
I used app-template-svelte and app-template-blank-typescript as basement and app-template-react-typescript as source for some help.
[x] Support for .ts files in general
[x] Typescript as default language for <script> tags in svelte components
[x] Types check for .ts files
[x] Types check for .svelte files (via svelte-check one time during the build or start only)
[x] Support for Typescript in test.ts files (jest)
To achieve some of the goals above I introduced additional things that may be useful (similar to other templates/scripts):
[x] app-scripts-svelte/jest.config.js will using preprocessors from svelte.config.js if presented.
[x] app-scripts-svelte/jest/babelTransform.js will use babel.config.json if presented.
I guess also would be nice to add (but I did not find a way for this yet):
[ ] Watch mode for checking types in .svelte components
[ ] Types check for .test.ts files during test run
Hello everyone.
I recently started a new project and decided to go with Snowpack, Typescript and Svelte. There is no many tutorials or examples how to do the complete setup, so after I made it work for myself I decided to share my findings as create app template. I hope it maybe useful and will save someone some time.
I used
app-template-svelte
andapp-template-blank-typescript
as basement andapp-template-react-typescript
as source for some help..ts
files in general<script>
tags in svelte components.ts
files.svelte
files (viasvelte-check
one time during the build or start only)test.ts
files (jest)To achieve some of the goals above I introduced additional things that may be useful (similar to other templates/scripts):
app-scripts-svelte/jest.config.js
will using preprocessors fromsvelte.config.js
if presented.app-scripts-svelte/jest/babelTransform.js
will usebabel.config.json
if presented.I guess also would be nice to add (but I did not find a way for this yet):
.svelte
components.test.ts
files during test run