Skip to content
Public template

About

SolidJS SPA template with Vite, static hosting (GH Pages + file://), vitest-browser-solid TDD

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Note

This is template repository for website projects, and not a library. Check out library template.

How to use

git clone <repository-url> template-solid

Requirements

Node.js 26.0.0 or higher is required. This version supports the TypeScript syntax used by oxlint.config.ts.

Getting Started

This project uses pnpm. Install dependencies:

pnpm install

pnpm install runs the postinstall script, which installs the git hooks (pre-commit runs pnpm run check; pre-push enforces the dev/* branch naming convention).

Conventions and Rules

This project follows specific conventions and rules for code style, data validation, testing, and more. Please refer to the following documentation for detailed guidelines.


Static Hosting

Deploy the dist/ output in a browser secure context: use HTTPS in production or localhost for development and preview (for example, pnpm preview). Plain HTTP on a remote origin and file:// are unsupported. A plain pnpm build emits relative asset URLs, so the output serves correctly from a domain root or a GitHub Pages project site subpath (https://<user>.github.io/<repo>/). For History API routing below the domain root, rebuild with the site's absolute base path, e.g. pnpm build --base "/<repo>/"; the included deploy workflow supplies this base automatically.

GitHub Pages fallback responses retain an HTTP 404 status even when SolidJS renders a valid client route. This can affect SEO, crawlers, and link previews. Unknown client routes render the application's Page not found view.

file:// viewing is unsupported.

Tests

Vitest has separate Node (tests/unit/) and jsdom (tests/browser/) projects. Browser fixtures use @solidjs/testing-library and exercise rendered user behavior, including route navigation.

Solid version

This template uses the stable Solid 1.x stack. Solid 2 is in release-candidate status and requires a coordinated migration of the runtime, renderer, JSX compiler, router, and Vite plugin; do not upgrade solid-js by itself. See the Solid 1.x to 2.0 migration guide before evaluating that migration.

About

SolidJS SPA template with Vite, static hosting (GH Pages + file://), vitest-browser-solid TDD

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages