Skip to content

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.

Terminal window
# React starter (default)
npx @zntc/init web --framework=react
# Vanilla TS starter
npx @zntc/init web --framework=vanilla

Options:

OptionDescription
--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.
--forceOverwrite existing files.
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.tsx

Generated 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,
});
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.ts

The generated package.json scripts:

{
"scripts": {
"dev": "zntc dev",
"build": "zntc build",
"preview": "zntc preview"
}
}
Terminal window
# use the package manager hint printed by init (bun / npm / pnpm / yarn)
bun install
bun run dev # ZNTC dev server (HMR)
bun run build # production bundle into dist/
bun run preview # preview dist/
SituationRecommended mode
Starting from scratch (no tooling chosen yet)zntc-init web — ZNTC only.
Existing Vite projectzntc-init vite
Existing Rspack / Webpack projectzntc-init rspack
Existing React Native CLI projectzntc-init react-native
  • Dev Serverzntc dev SSE / MCP / Live Reload behavior.
  • Config File — full zntc.config.ts options and functional config.
  • Plugin Recipes — CSS / PostCSS / Tailwind / SVG plugin patterns.