Svelte is a frontend framework which is used to build fast applications. But it is used for creating a single page app without navigation. In this article we will learn quickly how to install and create a project in Svelte.
After downloading Nodejs, we are ready for Svelte. Open command prompt and move to the directory where you want to create the project. Then use this command –
npx degit sveltejs/template my-project-name
my-project-name with the name of your project.
Let the process complete and then move to the project folder using this command –
my-project-name with your project name.
It’s time to install all the dependencies listed in
package.json file. Use the below command –
This will take a while. After it gets completed, you will have a well setup project.
In order to run it, use this command –
npm run dev
It will provide you a localhost url with port. The default url for Svelte is – http://localhost:5000
Now you can move on with the development.
When you are ready to publish your web app, you can make the production build with this command –
npm run build