콘텐츠로 이동

Web (standalone)

zntc-init web 은 기존 도구 없이 ZNTC 만으로 동작하는 새 웹 프로젝트를 빈 디렉토리에 scaffold 합니다. Vite / Rspack 위에 얹는 overlay 모드와 달리 starter 템플릿을 통째로 생성합니다.

Terminal window
# React 스타터 (기본)
npx @zntc/init web --framework=react
# Vanilla TS 스타터
npx @zntc/init web --framework=vanilla

옵션:

옵션설명
--name <pkg-name>package.jsonname 필드. 기본값: 디렉토리 이름.
--framework <react|vanilla>스타터 템플릿. 기본값: react.
--root <dir>프로젝트 루트. 기본값: 현재 디렉터리.
--zntc-version <range>@zntc/* 패키지 버전 범위. 기본값: latest.
--force기존 파일 덮어쓰기.
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

생성된 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 만
├── tsconfig.json # strict, isolatedModules — JSX 미사용
├── zntc.config.ts # entryPoints: ["src/main.ts"]
└── src/
└── main.ts

자동 생성된 package.json 의 scripts:

{
"scripts": {
"dev": "zntc dev",
"build": "zntc build",
"preview": "zntc preview"
}
}
Terminal window
# init 출력 힌트의 패키지 매니저 (bun / npm / pnpm / yarn) 사용
bun install
bun run dev # ZNTC dev server (HMR)
bun run build # 프로덕션 번들 dist/
bun run preview # dist/ 미리보기
상황권장 모드
새 프로젝트 시작 (도구 선택 없음)zntc-init web — ZNTC 만으로 동작.
기존 Vite 프로젝트가 있음zntc-init vite
기존 Rspack / Webpack 프로젝트가 있음zntc-init rspack
기존 React Native CLI 프로젝트가 있음zntc-init react-native
  • Dev Serverzntc dev 의 SSE / MCP / Live Reload 동작.
  • Config Filezntc.config.ts 의 전체 옵션과 함수형 config.
  • Plugin Recipes — CSS / PostCSS / Tailwind / SVG 같은 자주 쓰는 plugin 패턴.