From frontend-craft
Standardizing Vite configurations, security boundaries, and build performance for apps, libraries, and monorepos. Covers plugins, env vars, dev server, HMR, and bundle optimization.
How this skill is triggered — by the user, by Claude, or both
Slash command
/frontend-craft:fec-vite-project-standardThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Design and review of Vite applications, component libraries, development servers, and build configurations.
Design and review of Vite applications, component libraries, development servers, and build configurations.
Standardize Vite configurations, security boundaries, and build performance to avoid common pitfalls of development environments and production builds.
Identify the project type
root, base, server.proxy, envPrefix, build and framework plugins first.build.lib, type products, peer dependencies external and export entries first.server.fs.allow, path aliases and package dependency boundaries.Select plugin
@vitejs/plugin-react-swc by default; use @vitejs/plugin-react only when the Babel plug-in is required.@vitejs/plugin-vue, and path aliases are given priority to vite-tsconfig-paths.tsc --noEmit, CI or vite-plugin-checker.Manage environment variables
VITE_.loadEnv uses an explicit prefix array and does not use an empty string to load all variables.Optimize development experience
vite --profile to locate plug-in, parsing or pre-built bottlenecks before slow start.optimizeDeps.include for CJS/UMD dependencies to handle interop issues.server.warmup.clientFiles to warm up the core entrance.Optimize production builds
vite build before release and use vite preview to do local build smoke testing.import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react-swc";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), ["VITE_"]);
return {
plugins: [react(), tsconfigPaths()],
define: {
__PUBLIC_API_URL__: JSON.stringify(env.VITE_API_URL),
},
server: {
proxy: {
"/api": {
target: "http://localhost:8080",
changeOrigin: true,
},
},
},
};
});
vite build only translates and packages, not type checking; CI must run typecheck separately.VITE_ is not a security boundary; any VITE_ variable goes into the client package.envPrefix: "", do not use loadEnv(mode, root, "") and then define at will.vite preview as a production server..d.ts separately.define, import.meta.env or empty prefix loadEnv.The output should include project type judgment, key configuration changes, environment variable security instructions, and build/development performance verification methods. When completed, the Vite configuration should be type-checked, buildable, secret-secure, and explain the differences between dev and build.
npx claudepluginhub bovinphang/frontend-craftVite build tool patterns: config, plugins, HMR, env variables, proxy, SSR, library mode, dependency pre-bundling, and build optimization for Vite-based projects.
Covers Vite build tool patterns: config, plugins, HMR, env vars, proxy, SSR, library mode, dependency pre-bundling, and build optimization. Activates when working with vite.config.ts, Vite plugins, or Vite-based projects.
Configures Vite build tool, plugin API, SSR, and Vite 8 Rolldown migration. Auto-activates when working with vite.config.ts, Vite plugins, or building SSR apps.