Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Setting Up a Svelte Project with Vite | Getting Started with Svelte
Introduction to Svelte

Setting Up a Svelte Project with Vite

Pyyhkäise näyttääksesi valikon

Before building Svelte components, you need to create a real Svelte project. In this chapter, you will use Vite, a modern frontend build tool, to generate and run your first Svelte application.

What Is Vite?

Vite is a tool that helps create and run modern frontend projects. It gives you a development server, project setup, fast refresh while coding, and a production build workflow.

For this course, you do not need to understand every Vite feature yet. You only need to know that Vite helps you start and run your Svelte project quickly.

1. Creating a Svelte Project

Open your terminal and run:

npm create vite@latest my-svelte-app

Then choose:

Svelte
JavaScript

After the project is created, move into the project folder:

cd my-svelte-app

Install the project dependencies:

npm install

2. Running the Project

Start the development server:

npm run dev

Vite will show a local development URL in the terminal. Open that URL in your browser to see your first Svelte application running.

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 3

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Osio 1. Luku 3
some-alt