forked from jjagielka/d3-gtimeline
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
29 lines (28 loc) · 813 Bytes
/
vite.config.js
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
// vite.config.js
import { resolve } from "path";
import { defineConfig } from "vite";
import d3_global from "./d3-global-plugin";
import d3_virtual from "./d3-virtual";
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, "src/index.js"),
// formats: ["es", "umd"],
name: "d3",
// the proper extensions will be added
// fileName: "d3-gtimeline",
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled into your library
external: ["dayjs", "d3"],
output: {
// Provide global variables to use in the UMD build for externalized deps
globals: {
dayjs: "dayjs",
d3: "d3",
},
},
},
},
plugins: [d3_global("dist/d3-gtimeline.umd.cjs"), d3_virtual()],
});