Some things to note about Svelte projects in STEMCstudio.
- The Svelte file must have the extension
.svelte
in order to be recognized as Svelte code. - A file called
Foo.svelte
will be compiled by STEMCstudio and the Svelte compiler toFoo.svelte.ts
, which means that the module name for the file will be./Foo.svelte
This module name is what you will use when importing the Svelte code into other files. - The
target
TypeScript compiler option intsconfig.json
must be set toes2015
or later. Note that thetsconfig.json
file may be hidden from the Explorer if theHide Configuration Files
option is checked inProject Settings
. Make sure this option is unchecked in order to maketsconfig.json
visible. - The package
svelte
must be added as a project dependency. This can be done in theDependencies
section of theProject Settings
dialog. Alternatively, the dependency can be added by editing thepackage.jon
file. Note that thepackage.json
file may be hidden from the Explorer if theHide Configuration Files
option is checked inProject Settings
. Make sure this option is unchecked in order to makepackage.json
visible.