Closed KIMGEUNDU closed 1 year ago
์ด๋ฏธ์ง์ต์ ํ ๋ฐฉ๋ฒ
Vite ์ฑ๋ฅ ์ต์ ํ ๊ตฌ์ฑ (์ฐธ๊ณ ) ํ ๊ธ ํ์ธํด์ ์ค์นํด์ผํจ main ๋ธ๋์น์์ ์ค์น ํ ํ์๋ค์ pull๋ก ๋น๊ธฐ๊ธฐ
vite.config.js ๋ณ๊ฒฝ
import react from "@vitejs/plugin-react"; import { resolve } from "node:path"; import { defineConfig } from "vite"; import { env } from "node:process"; import viteImagemin from "@vheemstra/vite-plugin-imagemin"; import imageminGifSicle from "imagemin-gifsicle"; import imageminMozjpeg from "imagemin-mozjpeg"; import imageminPngQuant from "imagemin-pngquant"; import imageminSvgo from "imagemin-svgo"; import imageminWebp from "imagemin-webp"; import { splitVendorChunkPlugin } from "vite"; const isDev = env.NODE_ENV === "development"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [ react(), splitVendorChunkPlugin(), viteImagemin({ plugins: { jpg: imageminMozjpeg(), png: imageminPngQuant(), gif: imageminGifSicle(), svg: imageminSvgo(), }, makeWebp: { plugins: { jpg: imageminWebp(), png: imageminWebp(), }, }, }), ], css: { devSourcemap: true, modules: { generateScopedName: isDev ? "[name]_[local]__[hash:base64:5]" : "[hash:base64:4]", }, }, resolve: { alias: { "@": resolve(__dirname, "./src"), }, }, // ๋น๋ ์, ์ฒญํฌ ํ์ผ ์์ฑ ๋งค๋ด์ผ ๊ตฌ์ฑ build: { rollupOptions: { output: { manualChunks: { react: ["react", "react-dom"], reactRouter: ["react-router-dom"], animations: ["framer-motion", "gsap"], }, }, }, }, });
์ด๋ฏธ์ง์ต์ ํ ๋ฐฉ๋ฒ
Vite ์ฑ๋ฅ ์ต์ ํ ๊ตฌ์ฑ (์ฐธ๊ณ ) ํ ๊ธ ํ์ธํด์ ์ค์นํด์ผํจ main ๋ธ๋์น์์ ์ค์น ํ ํ์๋ค์ pull๋ก ๋น๊ธฐ๊ธฐ
vite.config.js ๋ณ๊ฒฝ