Izac Wiki

Svelte and SvelteKit

Svelte and SvelteKit

Svelte is a component-based JavaScript framework that allows you to build user interfaces declaratively. It's similar to React, Vue, and Angular, but it's different in that it compiles your code at build time rather than at runtime. This means that your code is compiled into highly efficient vanilla JavaScript that runs in the browser.

SvelteKit is a framework for building web applications with Svelte. It's similar to Next.js and Nuxt.js, but it's different in that it's built on top of SvelteKit's file-based routing system. This means that you can build your entire application using only Svelte components and files.

Vite Svelte Project Setup

To create a new Vite Svelte project, run the following commands:

      
        
npm init vite@latest my-app -- --template svelte
cd my-app
npm install
npm run dev

SvelteKit project setup

To create a new SvelteKit project, run the following commands:

      
        
npm init svelte@next my-app
cd my-app
npm install
npm run dev