-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
42 lines (41 loc) · 1.02 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { defineConfig } from "vite";
import { resolve } from "path";
import react from "@vitejs/plugin-react-swc";
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
import libCss from "vite-plugin-libcss";
import dts from "vite-plugin-dts";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vanillaExtractPlugin(),
react(),
dts({
insertTypesEntry: true, // 컴포넌트 타입 생성
}),
libCss(),
],
resolve: {
alias: [{ find: "@", replacement: "/src" }],
},
build: {
lib: {
entry: resolve(__dirname, "src/index.ts"),
name: "@black-ui/react",
fileName: "index",
// 어떤 모듈형태로 빌드할건지 : es, umd, cjs
formats: ["es", "umd", "cjs"],
},
rollupOptions: {
treeshake: "recommended",
external: ["react", "react-dom"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
},
sourcemap: true,
emptyOutDir: true,
},
});