A modern Svelte project template with Vite, Tailwind CSS, Vitest, and Playwright pre-configured.
# Install dependencies
npm install
# Start development server
npm run dev
Open http://localhost:5173 to view your app.
npm run dev # Start dev server with HMR
npm run build # Build for production
npm run preview # Preview production build
# Unit tests with Vitest
npm run test # Run tests in watch mode
npm run test:ui # Run tests with UI
npm run test:coverage # Generate coverage report
# E2E tests with Playwright
npm run test:e2e # Run E2E tests
npm run test:e2e:ui # Run E2E tests with UI
npm run format # Format all files with Prettier
npm run format:check # Check formatting without making changes
npm run lint # Lint and fix issues with ESLint
npm run lint:check # Check for linting issues without fixing
svelte-vite-seed/
├── public/ # Static assets
│ └── vite.svg
├── src/
│ ├── assets/ # Component assets
│ │ └── svelte.svg
│ ├── lib/ # Reusable components
│ │ ├── Counter.svelte
│ │ └── Counter.test.js
│ ├── App.svelte # Root component
│ ├── app.css # Global styles with Tailwind
│ └── main.js # App entry point
├── tests/
│ └── e2e/ # Playwright tests
│ └── example.spec.js
├── index.html # HTML entry point
├── vite.config.js # Vite + Vitest config
├── svelte.config.js # Svelte config
├── tailwind.config.js # Tailwind config
├── postcss.config.js # PostCSS config
└── playwright.config.js # Playwright config
Prettier is configured to format code without semicolons. Configuration is in .prettierrc:
.svelte filesESLint is configured with Svelte support using the flat config format. Configuration is in eslint.config.js.
Pre-commit hooks are set up with Husky and lint-staged to automatically:
This ensures all committed code is properly formatted and linted.
Tailwind is configured to scan all .svelte and .js files in src/. Customize in tailwind.config.js.
Unit tests are configured to run with jsdom environment. Place tests alongside components with .test.js extension.
E2E tests are in tests/e2e/. Playwright automatically starts the dev server before running tests.
To install Playwright browsers:
npx playwright install
npm run build
The build output will be in the dist/ directory, ready to deploy to any static hosting service.
This template is intentionally minimal. Add what you need:
MIT