-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvite.config.ts
41 lines (38 loc) · 1.09 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
import path from "path";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
test: {
globals: true,
environment: "jsdom",
},
plugins: [tsconfigPaths()],
optimizeDeps: {
exclude: ["cubecubed"],
},
build: {
lib: {
entry: path.resolve(__dirname, "src/index.ts"),
name: "cubecubed",
fileName: (format) => {
const meta = "cubecubed";
if (format === "cjs") return `${meta}.cjs`;
if (format === "es") return `${meta}.module.js`;
if (format === "iife") return `${meta}.min.js`;
if (format === "umd") return `${meta}.js`;
return `${meta}.js`;
},
formats: ["cjs", "es", "iife", "umd"],
},
rollupOptions: {
external: [
"d3",
"d3-simple-slider",
"inquirer",
"katex",
"tex-to-svg",
"three",
],
},
},
});