Quick setup Svelte 3 SPA: svelte3-app
Oleksandr Demian
Posted on March 28, 2020
Introduction
svelte3-app is an npx command for quick setup of your svelte 3 project.
You don't have to install it locally, but be sure you have at least npm@5.2.0 version installed.
Basic usage
npx svelte3-app
The command above will create a svelte project based on the official template configured with Rollup in the folder you run it within.
It offers some customization for your project. For example, you can decide whenever to use Rollup or Webpack as your bundler or to create a project using Sapper.
Inputs
- -n -> the name of the project (if empty, the project will be created in the directory it called within, ex: npx svelte3-app -n client)
- -s -> initialize the project with sapper framework (ex: npx svelte3-app -s, value is not required, but you can pass true right after)
- -b -> bundler to use (rollup is default, ex: npx svelte3-app -b webpack)
Examples
1) Create a svelte 3 project under svelte-rollup folder configured with rollup:
npx svelte3-app -n svelte-rollup
2) Create a svelte 3 project under svelte-webpack folder configured with webpack:
npx svelte3-app -n svelte-webpack -b webpack
3) Create a svelte 3 project under sapper-rollup folder configured with rollup and sapper:
npx svelte3-app -n sapper-rollup -s
4) Create a svelte 3 project under sapper-webpack folder configured with webpack and sapper:
npx svelte3-app -n sapper-webpack -b webpack -s
Posted on March 28, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 26, 2024
November 26, 2024