hosting-vite
0
总安装量
1
周安装量
安装命令
npx skills add https://github.com/pauloviccs/viccs_antigravity_skillscreator --skill hosting-vite
Agent 安装分布
amp
1
cline
1
openclaw
1
trae
1
opencode
1
cursor
1
Skill 文档
Hosting & Using Vite
When to use this skill
- When the user wants to start a new frontend project (React, Vue, Svelte, etc.).
- When the user mentions “Vite”, “dev server”, or “bundling”.
- When the user needs to build a project for production (
npm run build).
Workflow
- Scaffold Project:
- Use
npm create vite@latestto start the interactive setup. - Select framework (React, Vue, Vanilla, etc.) and variant (TypeScript recommended).
- Alternatively:
npm create vite@latest my-app -- --template react-tsfor one-line setup.
- Use
- Development:
npm install: Install dependencies.npm run dev: Start the dev server (default port 5173).- Features: Hot Module Replacement (HMR) is active by default.
- Configuration:
- Edit
vite.config.tsfor plugins, aliases, and build settings.
- Edit
- Production Build:
npm run build: Bundles the app intodist/.npm run preview: Preview the production build locally.
Instructions
- Entry Point:
index.htmlis the entry point and must reside in the project root. It should reference your main JS/TS file:<script type="module" src="/src/main.tsx"></script>. - Static Assets: Place static files (robots.txt, favicon) in the
public/directory. They will be copied todist/root on build. - Environment Variables: Use
.envfiles. Variables must start withVITE_to be exposed to the client (e.g.,VITE_API_URL). Access viaimport.meta.env.VITE_API_URL. - CSS: Import CSS directly in JS files. Vite handles pre-processors (Sass, Less) if you install them (e.g.,
npm add -D sass).
CLI Cheatsheet
vite: Start dev server.vite build: Build for production.vite preview: Serve thedistfolder.vite --port 3000: Specify custom port.