Original template: sveltejs/template
Duct-tape template for svelte + typescript with aliases copied to rollup from the path aliases in tsconfig.json
For convenience the @svelte
alias is already configured in the tsconfig like so:
...
"@svelte": [
"node_modules/svelte",
"node_modules/svelte/index"
],
"@svelte/*": [
"node_modules/svelte/*",
"node_modules/svelte/*/index"
]
...
The first alias adds the package itself
The second alias adds the subpackages
If you wish to alias your own folders then you only need the second alias, for example:
...
"@lorem-ipsum/*": [
"src/lorem/ipsum/*"
]
...
Then you'll be able to use that during imports like:
import { sit, amet } from "@lorem-ipsum/dolor"
Only the first string in the array of each path in the tsconfig-alias will be transformed into a rollup-alias, the rest are for the TS server to stop complaining