Skip to content

Repository files navigation

SolidJS Vite Template

A modern SolidJS template with routing, powered by Vite.

Features

Getting Started

Installation

This template uses pnpm for dependency management, but any package manager will work.

# Install dependencies
pnpm install
# or
npm install
# or
yarn install

Development

# Start development server
pnpm dev
# or
npm run dev

Open http://localhost:5173 to view it in the browser.

The page will reload automatically when you make edits.

Build

# Build for production
pnpm build
# or
npm run build

Builds the app for production to the dist folder. The build is minified and optimized for the best performance.

Preview

# Preview production build
pnpm serve
# or
npm run serve

Preview the production build locally before deployment.

Project Structure

├── src/
│   ├── components/     # Reusable components
│   │   └── Nav.tsx     # Navigation component
│   ├── pages/          # Route pages (file-based routing)
│   ├── app.tsx         # Root component with layout
│   ├── index.tsx       # Application entry point
│   └── index.css       # Global styles
├── public/             # Static assets
└── package.json

About This Template

This template showcases the routing capabilities of SolidJS and demonstrates how the router works with Suspense to parallelize data fetching using the .data.ts pattern.

Key Concepts

  • File-based Routing: Pages are automatically generated from files in the pages/ directory
  • Component Architecture: Modular component structure with separated concerns
  • Reactive Data Flow: Leverages SolidJS's fine-grained reactivity
  • Suspense Integration: Efficient data loading with automatic loading states

Deployment

Deploy the dist folder to any static hosting provider:

Learn More

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors