-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
30 lines (29 loc) · 971 Bytes
/
vite.config.js
File metadata and controls
30 lines (29 loc) · 971 Bytes
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
import dts from "vite-plugin-dts";
import { resolve } from "path";
import { defineConfig } from "vite";
export default defineConfig ({
build: {
// Tells Vite we're building library code as opposed to application code
lib: {
entry: {
lib: resolve(__dirname, "src/lib.ts"),
types: resolve(__dirname, "src/types.ts")
},
// Component library name
name: "components-library",
formats: ["es"],
},
plugins: [dts({ rollupTypes: true })],
rollupOptions: {
// Provide global variables to use in the UMD build for externalized deps
output: {
globals: {
react: "React",
"react-dom": "ReactDom"
}
},
// Externalize deps that shouldn't be bundled into the library
external: ["react", "react-dom"]
}
}
});