-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.js
More file actions
43 lines (42 loc) · 1.17 KB
/
Copy pathvite.config.js
File metadata and controls
43 lines (42 loc) · 1.17 KB
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
42
43
import { defineConfig } from "vite";
import { resolve } from "path";
import dts from "vite-plugin-dts";
import typescript from "@rollup/plugin-typescript";
export default defineConfig({
build: {
lib: {
// The entry point for your library
entry: resolve(__dirname, "src/index.tsx"),
// The name that will be used for the global variable in UMD builds
name: "UserJourneyTracker",
// Output file formats
formats: ["es", "umd"],
// File name pattern for output
fileName: (format) => `user-journey-tracker.${format}.js`,
},
rollupOptions: {
// Make sure to externalize dependencies that shouldn't be bundled
external: [], // No external dependencies for this library
output: {
// Global variable names used in UMD build
globals: {},
amd: {
define: false,
},
},
},
// Generate source maps
sourcemap: false,
// Minify the output
minify: "terser",
},
plugins: [
// Generate TypeScript declaration files
dts(),
typescript({
tsconfig: "./tsconfig.json",
declaration: true,
declarationDir: "dist/types",
}),
],
});