Skip to content

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.

AliasResolution
$rootRails.root
$appRails.root.join("app")
$viewsRails.root.join("app", "views")

Example

View

svelte
  <script>
    import Card from "$views/application/card.html.svelte"
  </script>
  
  <Card/>