8000 minista/packages/minista at main · qrac/minista · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History

minista

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
< 966E div class="react-directory-filename-cell">
 
 
 
 

README.md

minista

Site & Documentation

About

minista is a static site generator for building 100% static websites with React JSX and Vite.

Concept

  • Write everything in JSX and generate clean HTML!
  • Bring JSX-based component development to web production workflows that require static HTML
  • Use TypeScript with excellent editor support instead of proprietary syntax

Features

  • All features are provided as Vite plugins
  • Uses the Vite Environment API to build the render and client environments sequentially
  • Outputs route, page, asset, and diagnostic data as JSON files in .minista

Setup

Requires Node.js 20.19 or later, or 22.12 or later, Vite 8.1 or later, and React / React DOM 19 or later. Using the latest Vite minor release is recommended.

Automatic

npm create minista@latest

Manual

npm install --save-dev minista vite react react-dom
touch ./vite.config.js
mkdir -p ./src/pages
touch ./src/pages/index.jsx
// ./vite.config.js
import { pluginSsg } from "minista"

export default {
  plugins: [pluginSsg()],
}
// ./src/pages/index.jsx
export default function () {
  return <h1>Hello!</h1>
}

Open package.json and add the following scripts:

{
  "scripts": {
    "dev": "minista",
    "build": "minista build",
    "preview": "minista preview"
  }
}

CLI

Command Description
minista [root] Start development mode (Ctrl + C to stop)
minista build [root] Generate the static build using Vite
minista preview [root] Preview the generated static build
minista check [root] Validate routes, pages, and getStaticData()
minista inspect [root] Show an overview of the Project Graph
minista agents [root] Show the agent guide, or add instructions with --write
minista explain <node-id> [root] Explain the relationships of a Graph node

check, inspect, and explain support --json.

To inspect only the generated manifest.json in the workspace after a build, use:

minista inspect --manifest --json

The v4 --oneBuild option was removed in v5. Using it exits with MINISTA_CLI_OPTION_REMOVED. The standard minista build command builds the render and client environments through Vite.

Config

All Vite configuration options are available.

Both vite.config.{ts,js} and minista.config.{ts,js} are supported, and you can also use defineConfig.

// ./vite.config.ts
import { defineConfig, pluginSsg } from "minista"

export default defineConfig({
  plugins: [pluginSsg()],
})

minista uses the Vite Environment API to build the render and client environments sequentially. Use environments when you need environment-specific configuration.

// ./vite.config.ts
import { defineConfig, pluginSsg } from "minista"

export default defineConfig({
  plugins: [pluginSsg()],
  environments: {
    client: {
      build: { minify: false },
    },
  },
})

Configs that reference the existing isSsrBuild option fall back to the compatibility builder. See Config for details.

If the project root contains a package.json, the generated workspace is located at node_modules/.minista/. Otherwise, it is located at .minista/.

Plugins

Each minista feature is enabled by adding its bundled plugin to the Vite configuration.

License

  • MIT

Credit

0