astro/examples/framework-svelte
Kaffee☕ 57b0c170e8
change the typescript moduleResolution of all examples to "node" (#1108)
* Fixes many Errors related to typescript

Fix Svelte Component Errors importing Svelte standard functions using typescript see https://github.com/snowpackjs/astro/issues/403.
Also fixes "ReferenceError: exports is not defined" see https://github.com/snowpackjs/astro/issues/969.

* change typescript default moduleresolution in examples see #403
2021-08-13 16:31:44 -07:00
..
src Reduce meta viewport tag (#1006) 2021-08-04 08:30:58 -04:00
.gitignore Restructure examples (#568) 2021-06-28 10:46:10 -05:00
.npmrc Restructure examples (#568) 2021-06-28 10:46:10 -05:00
astro.config.mjs [ci] yarn format 2021-07-20 04:07:49 +00:00
package.json Version Packages (next) (#1092) 2021-08-12 01:39:34 -07:00
README.md Expose JSX compilation to renderers (#588) 2021-07-21 18:10:03 -05:00
tsconfig.json change the typescript moduleResolution of all examples to "node" (#1108) 2021-08-13 16:31:44 -07: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.