-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
26 lines (24 loc) · 723 Bytes
/
vite.config.ts
File metadata and controls
26 lines (24 loc) · 723 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
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
export default defineConfig({
build: {
minify: "esbuild",
lib: {
entry: fileURLToPath(new URL("src/index.ts", import.meta.url)),
fileName: (format) =>
{
if (format === "cjs") { return "core.cjs"; }
if (format === "es") { return "core.esm.js"; }
if (format === "iife") { return "core.global.js"; }
if (format === "umd") { return "core.umd.cjs"; }
throw new Error(`Unknown build format: ${format}`);
},
formats: ["cjs", "es", "iife", "umd"],
name: "Core"
},
rollupOptions: {
output: { exports: "named" }
},
sourcemap: true
}
});