본문으로 건너뛰기
cccskills
무료GitHub에 공개

fec-vite-project-standard

Use when creating, configuring, reviewing, or debugging Vite-based frontend projects, vite.config.ts, env variables, dev server proxy, HMR, plugin ordering, library mode, dependency pre-bundling, bundle splitting, or Vite build performance. Use framework-specific skills for React/Vue component architecture; Chinese triggers include Vite configuration, vite.config, Vite build, Vite performance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Vite Project Specifications

Design and review of Vite applications, component libraries, development servers, and build configurations.

Purpose

Standardize Vite configurations, security boundaries, and build performance to avoid common pitfalls of development environments and production builds.

Procedure

  1. Identify the project type

    • Application projects check root, base, server.proxy, envPrefix, build and framework plugins first.
    • Component library projects check build.lib, type products, peer dependencies external and export entries first.
    • Monorepo additional checks for server.fs.allow, path aliases and package dependency boundaries.
  2. Select plugin

    • React gives priority to @vitejs/plugin-react-swc by default; use @vitejs/plugin-react only when the Babel plug-in is required.
    • The Vue project uses @vitejs/plugin-vue, and path aliases are given priority to vite-tsconfig-paths.
    • TypeScript projects must complete type checking via tsc --noEmit, CI or vite-plugin-checker.
  3. Manage environment variables

    • Clients only read explicitly exposed prefixes, such as VITE_.
    • The third parameter of loadEnv uses an explicit prefix array and does not use an empty string to load all variables.
    • Keys, database addresses, and private tokens must stay on the server or build system and not enter the client bundle.
  4. Optimize development experience

    • Use vite --profile to locate plug-in, parsing or pre-built bottlenecks before slow start.
    • Use optimizeDeps.include for CJS/UMD dependencies to handle interop issues.
    • Large projects can use server.warmup.clientFiles to warm up the core entrance.
  5. Optimize production builds

    • Run vite build before release and use vite preview to do local build smoke testing.
    • Prioritize manual subcontracting by using stable object forms to avoid splitting each dependency into independent small chunks.
    • The production sourcemap is turned off by default; if uploaded to the error tracking platform, it will not be published with the site after uploading.
    • Motion effects, 3D, charts, editors, maps, and audio and video processing libraries are prioritized for isolation through dynamic import or route-level unpacking.
    • Check whether static resources go into the correct directory, have been hashed/cache, have placeholder URLs, or are too large uncompressed media.

Minimal Config

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

Constraints

  • 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.
  • Do not set envPrefix: "", do not use loadEnv(mode, root, "") and then define at will.
  • Legacy plugins are not introduced by default; only enable them when needed for real user data.
  • Don't use vite preview as a production server.
  • Component libraries must externalize peer dependencies and produce .d.ts separately.
  • Do not inject server keys into clients via define, import.meta.env or empty prefix loadEnv.
  • Do not put heavy libraries such as GSAP, Three.js, Lottie, Monaco, and Map SDK into all page sharing entries; first evaluate the impact of async chunk and first screen.

Expected Output

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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

用于审查或改进前端无障碍、语义结构、键盘支持、焦点管理、ARIA 标签、屏幕阅读器行为、WCAG 2.2 问题、触控无障碍或辅助技术回归;中文触发词包括 无障碍、accessibility、a11y、WCAG、屏幕阅读器。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bovinphang/frontend-craft222026년 9월 26일 업데이트

Use when reviewing or improving frontend accessibility, semantic structure, keyboard support, focus management, ARIA labels, screen reader behavior, WCAG 2.2 issues, touch accessibility, or assistive-technology regressions; Chinese triggers include accessibility, accessibility, a11y, WCAG, screen reader.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bovinphang/frontend-craft222026년 9월 26일 업데이트

Use when absorbing ideas, capabilities, workflows, architecture, quality systems, ecosystem extensions, or engineering practices from any reference system into the current project through original, project-native redesign rather than copying.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bovinphang/frontend-craft222026년 9월 26일 업데이트

用于从参考系统中吸收想法、能力、工作流、架构、质量体系、生态扩展或工程实践,并通过原创的项目内重设计转化为当前项目能力,而不是复制原实现。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bovinphang/frontend-craft222026년 9월 26일 업데이트

用于设计、实现或审查前后端 API 集成、类型化 API client、REST/tRPC/OpenAPI 客户端选型、认证刷新、API 错误映射、上传流程、SSE/WebSocket/轮询选择、CORS 相关前端行为或跨边界 loading/error 状态。不要用于纯后端服务架构或仅 TanStack Query 缓存策略;中文触发词包括 API 集成、前后端联调、typed API client、接口错误处理、SSE、WebSocket。

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bovinphang/frontend-craft222026년 9월 26일 업데이트

Use when designing, implementing, or reviewing frontend-to-backend API integration, typed API clients, REST/tRPC/OpenAPI client choices, auth refresh, API error mapping, upload flows, SSE/WebSocket/polling choices, CORS-facing frontend behavior, or cross-boundary loading/error states. Do not use for backend-only service architecture or TanStack Query cache policy alone; Chinese triggers include API integration, front-end and back-end joint debugging, typed API client, Interface error handling, SSE, WebSocket.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bovinphang/frontend-craft222026년 9월 26일 업데이트

bovinphang의 스킬 모두 보기

이 스킬의 문제 신고