Path aliases
Path aliases are used as quick references from your Svelte views to key paths in your application.
They are primarily utilized when importing other Svelte components (i.e. partials).
Preconfigured
These are the aliases set by the generator in the global configuration file and can be changed.
Alias | Resolution |
---|---|
$root | Rails.root |
$app | Rails.root.join("app") |
$views | Rails.root.join("app", "views") |
Example
View
svelte
<script>
import Card from "$views/application/card.html.svelte"
</script>
<Card/>