Web (standalone)
zntc-init web scaffolds a new web project that runs on ZNTC alone, into an empty directory. Unlike the Vite / Rspack overlay modes, it generates a full starter template from scratch.
Command
Section titled “Command”# React starter (default)npx @zntc/init web --framework=react
# Vanilla TS starternpx @zntc/init web --framework=vanillaOptions:
| Option | Description |
|---|---|
--name <pkg-name> | package.json’s name field. Defaults to the directory name. |
--framework <react|vanilla> | Starter template. Defaults to react. |
--root <dir> | Project root. Defaults to cwd. |
--zntc-version <range> | Version range for @zntc/* packages. Defaults to latest. |
--force | Overwrite existing files. |
Generated files
Section titled “Generated files”React template
Section titled “React template”my-app/├── index.html # <div id="root"> + <script type="module" src="/src/main.tsx">├── package.json # react@^19, react-dom@^19, @zntc/core, typescript├── tsconfig.json # jsx: react-jsx, strict, isolatedModules, moduleResolution: Bundler├── zntc.config.ts # defineConfig: entryPoints / outdir / platform=browser / target=es2022 / jsx=automatic / sourcemap└── src/ ├── main.tsx # createRoot(...).render(<App />) └── App.tsxGenerated zntc.config.ts:
import { defineConfig } from "@zntc/core";
export default defineConfig({ entryPoints: ["src/main.tsx"], outdir: "dist", format: "esm", platform: "browser", target: "es2022", jsx: "automatic", sourcemap: true,});Vanilla template
Section titled “Vanilla template”my-app/├── index.html # <div id="app"> + <script type="module" src="/src/main.ts">├── package.json # @zntc/core + typescript only├── tsconfig.json # strict, isolatedModules — no JSX├── zntc.config.ts # entryPoints: ["src/main.ts"]└── src/ └── main.tsDev commands
Section titled “Dev commands”The generated package.json scripts:
{ "scripts": { "dev": "zntc dev", "build": "zntc build", "preview": "zntc preview" }}# use the package manager hint printed by init (bun / npm / pnpm / yarn)bun installbun run dev # ZNTC dev server (HMR)bun run build # production bundle into dist/bun run preview # preview dist/When to use web mode
Section titled “When to use web mode”| Situation | Recommended mode |
|---|---|
| Starting from scratch (no tooling chosen yet) | zntc-init web — ZNTC only. |
| Existing Vite project | zntc-init vite |
| Existing Rspack / Webpack project | zntc-init rspack |
| Existing React Native CLI project | zntc-init react-native |
See also
Section titled “See also”- Dev Server —
zntc devSSE / MCP / Live Reload behavior. - Config File — full
zntc.config.tsoptions and functional config. - Plugin Recipes — CSS / PostCSS / Tailwind / SVG plugin patterns.