Skip to content

bfanger/svelte-project-template

Repository files navigation

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 ~166M to ~288M.

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