svelte-effect-nix-template Svelte Themes

Svelte Effect Nix Template

Svelte + Effect + Nix template. Reproducible builds, tests, dev environment, formatting.

Svelte Effect Nix Template

This is a Nix-powered Svelte template with Effect integration. It builds an app fully reproducibly, including tests.

To quickly get started with this template, run:

mkdir project
cd project
nix flake init -t github:cor/svelte-effect-nix-template
git init

Building and Running

Building the App

To build the app, run:

nix build

This will:

  1. Install all dependencies
  2. Run the tests using Vitest
  3. Build the application
  4. Output the result to ./result

Previewing the App

To preview the built app in a browser, run:

nix run

This will:

  1. Build the app if it hasn't been built already
  2. Start a local server using miniserve
  3. Serve the app on http://localhost:8080

The preview server uses SPA mode, so client-side routing will work correctly.

Development

Development Server

To start the development server with hot reloading:

nix run .#dev

This will install dependencies and start the Svelte development server.

Development Shell

To enter a development shell with all necessary tools:

nix develop

This provides:

  • Node.js and npm
  • TypeScript language server
  • Svelte language server
  • Tailwind CSS language server
  • Other development tools

Formatting Code

Format all code in the project with:

nix fmt

This uses:

  • Prettier to format TypeScript, JavaScript, JSON, Markdown, Svelte, HTML, and CSS files according to the project's configuration in .prettierrc
  • nixpkgs-fmt to format Nix files

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes