0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/examples/framework-svelte
github-actions[bot] b863c05ae6
Version Packages (next) (#845)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-07-24 16:02:25 -07:00
..
src Update docs in compiler messages (#710) 2021-07-16 07:01:31 -04:00
.gitignore
.npmrc
astro.config.mjs [ci] yarn format 2021-07-20 04:07:49 +00:00
package.json Version Packages (next) (#845) 2021-07-24 16:02:25 -07:00
README.md Expose JSX compilation to renderers (#588) 2021-07-21 18:10:03 -05:00

Using Svelte with Astro

This example showcases Astro's built-in support for Svelte.

Installation

Automatic

Bootstrap your Astro project with this template!

npm init astro -- --template framework-svelte

Manual

To use Svelte components in your Astro project:

  1. Install @astrojs/renderer-svelte

    npm i @astrojs/renderer-svelte
    
  2. Add "@astrojs/renderer-svelte" to your renderers in astro.config.mjs.

    export default {
      renderers: [
        "@astrojs/renderer-svelte",
        // optionally, others...
      ]
    }
    

Usage

Write your Svelte components as .svelte files in your project.