Svelte Project Template

Svelte project preconfigured with:

*1: To keep the installation speedy Vitest, Playwright and Storybook are disabled by default.

Initial setup

npx tiged "github.com/bfanger/svelte-project-template#main" my-svelte-project
cd my-svelte-project
git init --initial-branch main
git add .
pnpm install     # or  npm install
cp -n env.example .env
pnpm dev --open  # or  npm run dev -- --open

Enabling Testing & Storybook

node ./enable-testing.js
pnpm install  # or  npm install
  • Creates the configuration files
  • Creates an example unittest
  • Creates an example e2e test
  • Creates an example storybook story
  • node_modules grows from ~240M to ~475M.

Linting

pnpm lint  # or  npm run lint

I'd recommend enabling format-on-save in your editor, but to apply all auto fixes manually:

pnpm format  # or  npm run format

Build

pnpm build             # or  npm run build
npx serve@latest build # or  npm run preview

Top categories

svelte logo

Want a Svelte site built?

Hire a Svelte developer
Loading Svelte Themes