vite
하는 일
이 스킬은 웹 앱을 위한 빠른 빌드 및 개발 도구인 Vite를 설정하고 조정하도록 AI를 안내합니다. 빠른 새로고침과 효율적인 빌드를 원하는 프런트엔드 개발자를 위한 것입니다.
사용하는 경우
- ✓새 웹 앱을 시작하면서 빠른 개발 환경을 원할 때.
- ✓빌드가 느리거나 프로덕션 번들이 너무 클 때.
- ✓Vite 프로젝트의 환경 변수를 설정해야 할 때.
스킬 링크
https://github.com/debpalash/VoiceStudio/blob/main/.agents/skills/vite/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“React 프로젝트에 Vite를 설정해 주세요. src 폴더에 대한 별칭과 환경 파일의 API 주소를 포함해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 플러그인, 별칭, 개발 서버가 포함된 Vite 설정 파일을 만듭니다. 그다음 개발과 프로덕션에서 코드가 환경 변수를 어떻게 읽는지 보여 줍니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Vite Development
You are an expert in Vite, modern JavaScript/TypeScript build tooling, and frontend development.
Key Principles
- Leverage native ES modules for fast development
- Use Vite's opinionated defaults when possible
- Configure only what needs customization
- Understand the dev/build differences
- Optimize for both development speed and production performance
Project Setup
Basic Configuration
// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
server: {
port: 3000,
open: true,
},
build: {
outDir: 'dist',
sourcemap: true,
},
});
Path Aliases
import { defineConfig } from 'vite';
export default defineConfig({
resolve: {
alias: {
'@': new URL('./src', import.meta.url).pathname,
'@components': new URL('./src/components', import.meta.url).pathname,
'@utils': new URL('./src/utils', import.meta.url).pathname,
},
},
});
Environment Variables
Usage
// .env
VITE_API_URL=https://api.example.com
VITE_APP_TITLE=My App
// In code
const apiUrl = import.meta.env.VITE_API_URL;
const isDev = import.meta.env.DEV;
const isProd = import.meta.env.PROD;
const mode = import.meta.env.MODE;
Type Definitions
// src/vite-env.d.ts
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_API_URL: string;
readonly VITE_APP_TITLE: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}
Hot Module Replacement
Manual HMR
// For libraries without HMR support
if (import.meta.hot) {
import.meta.hot.accept('./module.ts', (newModule) => {
// Handle the updated module
console.log('Module updated:', newModule);
});
import.meta.hot.dispose(() => {
// Cleanup before module is replaced
});
}
Asset Handling
Static Assets
// Import as URL
import imageUrl from './image.png';
// <img src={imageUrl} />
// Import as string (raw)
import shaderCode from './shader.glsl?raw';
// Import as worker
import Worker from './worker.ts?worker';
const worker = new Worker();
Public Directory
public/
├── favicon.ico # Served at /favicon.ico
├── robots.txt # Served at /robots.txt
└── images/ # Served at /images/
Framework Integrations
React
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [
react({
// Babel plugins
babel: {
plugins: ['@emotion/babel-plugin'],
},
}),
],
});
Vue
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
plugins: [vue()],
});
Svelte
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
export default defineConfig({
plugins: [svelte()],
});
Build Optimization
Code Splitting
// Dynamic imports create separate chunks
const AdminPanel = lazy(() => import('./AdminPanel'));
// Manual chunks
export default defineConfig({
build: {
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom'],
utils: ['lodash', 'date-fns'],
},
},
},
},
});
Chunk Size Optimization
export default defineConfig({
build: {
chunkSizeWarningLimit: 500,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return id.split('node_modules/')[1].split('/')[0];
}
},
},
},
},
});
CSS Handling
CSS Modules
// styles.module.css is auto-detected
import styles from './styles.module.css';
// <div className={styles.container}>
PostCSS
// postcss.config.js
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
Preprocessors
// Automatically handled with package installed
// npm install -D sass
import './styles.scss';
Proxy Configuration
export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://localhost:4000',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
'/socket.io': {
target: 'ws://loca
자주 묻는 질문
Vite는 React에서만 작동하나요?
아닙니다. 스킬은 React 설정을 보여 주며 다른 프레임워크 통합도 언급합니다.
환경 변수는 어디에 보관하나요?
.env 파일에 보관하며, 코드에서는 import.meta.env를 통해 읽습니다.
빌드에 관해 스킬은 무엇을 말하나요?
개발 모드와 프로덕션 모드의 차이를 설명하므로, 최종 빌드에서 무엇이 바뀌는지 알 수 있습니다.
상세 정보
작성자의 원본 설명
Expert guidance for Vite development with modern build tooling, HMR, framework integrations, and performance optimization
repo: debpalash/VoiceStudio
인기도
- GitHub 스타
- 99k
- 순위
- #1288
- 라이선스
- AGPL-3.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
fastapi-python
99k깔끔한 구조, 타입 힌트, 비동기 처리로 FastAPI 웹 서비스를 만드는 방법을 에이전트에게 가르칩니다.
voicestudio
99k저장된 목소리로 음성을 생성하고, 오디오를 전사하며, 로컬 VoiceStudio 앱을 통해 더빙이나 내레이션 단계를 실행하도록 에이전트를 돕습니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.