Create a new SvelteKit project

Ben Patton
InstructorBen Patton
Share this video with your friends

Social Share Links

Send Tweet
Published 2 years ago
Updated a year ago

The first step to starting a SvelteKit projects is initialize the app with commands from SvelteKit's website.

npm create svelte@latest my-app
cd my-app
npm install
npm run dev -- --open

We'll then test our app is running by adding html to our src/routes/index.svelte route.

Ben Patton: [0:00] To get started, go to SvelteKit's website, kit.svelte.div. Scroll down to see the list of commands, and we're just going to run those commands. Run npm create Svelte. Yes, let's go with the skeleton project. [0:27] We're going to say no to the next few questions. I'm going to see the into my SvelteKit blog. We're going to run npm install.

[0:38] All right. Now, open your app. Our app is open with SvelteKit. Now, we see that [inaudible] is running on localhost:4000, so this is actually already running our app. If we go to localhost:4,000, it's already up and running. To test this, go to src/routes/index.svelte. Just add a simple <p> tag. You can make it say whatever you want. We're going to say, "Egghead Demo." Save it and there it is.

[1:16] In review, we went to SvelteKit's website and got started by running these commands, opening our app, and going to our index route and adding this <p> tag to test it, and there it is.

egghead
egghead
~ 2 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today