Setup Sapper to Build Apps with Svelte

John Lindquist
InstructorJohn Lindquist
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 3 years ago

Sapper is a framework to build apps with Svelte. Sapper provides a routing system, app stores for data, optimized builds, and many other features to help you get a performant app up and running quickly.

John Lindquist: [00:00] Use npx to use the degit tool, which can clone and remove the git information from GitHub repos. sveltejs/sapper-template is the repo we're going to grab. We'll type out sveltejs/sapper-template. On this repo, there's also a branch called rollup.

[00:22] To target that branch, we'll say, "#rollup" and then just name our app sapper-app. That's just the directory where we will clone and remove the git information. Grabbed all of that and dropped it into a sapper-app folder, which we can change into.

[00:38] You'll see if we list all the files it's a standard Node project with a package.json file. We can npm install the dependencies in there. We can open code inside of this folder to look at those files. We can see all the files listed over here. The index.svelte is open over here. Once we run npm run npm run dev, then it launches the app on localhost:3000.

[01:03] You can see our app has a home page, an about page, and a blog page. This home page is represented by our index.svelte. We can go ahead and delete stuff. Hit save. Now everything's gone. I just add an h1 that says, "Hello." Hit save. Now we have a giant Hello.

egghead
egghead
~ 4 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