โ† All skills
Tencent SkillHub ยท Developer Tools

Vite

Configure and optimize Vite for development, production builds, and library bundling.

skill openclawclawhub Free
0 Downloads
0 Stars
0 Installs
0 Score
High Signal

Configure and optimize Vite for development, production builds, and library bundling.

โฌ‡ 0 downloads โ˜… 0 stars Unverified but indexed

Install for OpenClaw

Quick setup
  1. Download the package from Yavira.
  2. Extract the archive and review SKILL.md first.
  3. Import or place the package into your OpenClaw setup.

Requirements

Target platform
OpenClaw
Install method
Manual import
Extraction
Extract archive
Prerequisites
OpenClaw
Primary doc
SKILL.md

Package facts

Download mode
Yavira redirect
Package format
ZIP package
Source platform
Tencent SkillHub
What's included
SKILL.md

Validation

  • Use the Yavira download entry.
  • Review SKILL.md after the package is downloaded.
  • Confirm the extracted package contains the expected setup assets.

Install with your agent

Agent handoff

Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.

  1. Download the package from Yavira.
  2. Extract it into a folder your agent can access.
  3. Paste one of the prompts below and point your agent at the extracted folder.
New install

I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.

Upgrade existing

I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.

Trust & source

Release facts

Source
Tencent SkillHub
Verification
Indexed source record
Version
1.0.0

Documentation

ClawHub primary doc Primary doc: SKILL.md 10 sections Open source page

Environment Variables

Only VITE_ prefixed vars are exposed to client code โ€” DB_PASSWORD stays server-side, VITE_API_URL is bundled Access via import.meta.env.VITE_* not process.env โ€” process.env is Node-only and undefined in browser .env.local overrides .env and is gitignored by default โ€” use for local secrets import.meta.env.MODE is development or production โ€” use for conditional logic, not NODE_ENV

CommonJS Compatibility

Pure ESM by default โ€” CommonJS packages need optimizeDeps.include for pre-bundling require() doesn't work in Vite โ€” use import or createRequire from module for dynamic requires Some packages ship broken ESM โ€” add to ssr.noExternal or optimizeDeps.exclude and let Vite transform them Named exports from CommonJS may fail โ€” use default import and destructure: import pkg from 'pkg'; const { method } = pkg

Dependency Pre-bundling

Vite pre-bundles dependencies on first run โ€” delete node_modules/.vite to force rebuild after package changes Large dependencies slow down dev server start โ€” add rarely-changing ones to optimizeDeps.include for persistent cache Linked local packages (npm link) aren't pre-bundled โ€” add to optimizeDeps.include explicitly optimizeDeps.force: true rebuilds every time โ€” only for debugging, kills dev performance

Path Aliases

Configure in both vite.config.ts AND tsconfig.json โ€” Vite uses its own, TypeScript uses tsconfig Use path.resolve(__dirname, './src') not relative paths โ€” relative breaks depending on working directory @/ alias is not built-in โ€” must configure manually unlike some frameworks // vite.config.ts resolve: { alias: { '@': path.resolve(__dirname, './src') } }

Dev Server Proxy

Proxy only works in dev โ€” production needs actual CORS config or reverse proxy changeOrigin: true rewrites Host header โ€” required for most APIs that check origin WebSocket proxy needs explicit ws: true โ€” HTTP proxy doesn't forward WS by default Trailing slashes matter: /api proxies /api/users, /api/ only proxies /api//users server: { proxy: { '/api': { target: 'http://localhost:3000', changeOrigin: true, rewrite: path => path.replace(/^\/api/, '') } } }

Static Assets

public/ files served at root, not processed โ€” use for favicons, robots.txt, files that need exact paths src/assets/ files are processed, hashed, can be imported โ€” use for images, fonts referenced in code Import assets to get resolved URL: import logo from './logo.png' โ€” hardcoded paths break after build new URL('./img.png', import.meta.url) for dynamic paths โ€” template literals with variables don't work

Build Optimization

build.rollupOptions.output.manualChunks for code splitting โ€” without it, one giant bundle Analyze bundle with rollup-plugin-visualizer โ€” find unexpected large dependencies build.target defaults to modern browsers โ€” set 'es2015' for legacy support, but increases bundle size build.cssCodeSplit: true (default) โ€” each async chunk gets its own CSS file

Library Mode

build.lib for npm packages โ€” different config from app mode Set external for peer dependencies โ€” don't bundle React/Vue into your library Generate types separately with tsc โ€” Vite doesn't emit .d.ts files Both ESM and CJS outputs: formats: ['es', 'cjs'] โ€” some consumers still need require()

HMR Issues

Circular imports break HMR โ€” refactor to break the cycle or full reload triggers State lost on HMR means component isn't accepting updates โ€” check for import.meta.hot.accept() CSS changes trigger full reload if imported in JS that doesn't accept HMR โ€” import CSS in components that do server.hmr.overlay: false hides error overlay โ€” useful for custom error handling but hides issues

SSR Configuration

ssr.external for Node-only packages โ€” prevents bundling node_modules in SSR build ssr.noExternal forces bundling โ€” needed for packages with browser-specific imports CSS imports fail in SSR by default โ€” use ?inline suffix or configure css.postcss for SSR

Category context

Code helpers, APIs, CLIs, browser automation, testing, and developer operations.

Source: Tencent SkillHub

Largest current source with strong distribution and engagement signals.

Package contents

Included in package
1 Docs
  • SKILL.md Primary doc