-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
34 lines (33 loc) · 944 Bytes
/
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
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import react from "@vitejs/plugin-react-swc";
import { resolve } from "path";
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
"@/components": resolve(__dirname, "./src/components"),
"@/utils": resolve(__dirname, "./src/utils"),
},
},
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, "src/index.ts"),
formats: ["es"],
// the proper extensions will be added
fileName: "index",
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ["react", "react-dom"],
},
},
css: {
modules: {
localsConvention: "camelCaseOnly",
},
},
plugins: [react(), dts({ exclude: ["stories/**/*.stories.tsx"], insertTypesEntry: true })],
});