-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathvite.config.ts
More file actions
29 lines (28 loc) · 813 Bytes
/
vite.config.ts
File metadata and controls
29 lines (28 loc) · 813 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
import path from "path";
import { defineConfig } from "vite";
import { version } from "./package.json";
export default defineConfig({
build: {
lib: {
// Use the TypeScript entry so Rollup sees ES modules and can generate a proper UMD bundle
entry: path.resolve(__dirname, "index.ts"),
fileName: () => "kuzzle.js",
name: "KuzzleSDK",
// Match the legacy Webpack output: single UMD bundle
formats: ["umd"],
},
outDir: "dist",
rollupOptions: {
output: {
banner: `// Kuzzle Javascript SDK version ${version}`,
// Expose build flags on the global scope for browser usage (mirrors old webpack define)
},
},
sourcemap: true,
target: "es2015",
},
define: {
SDKVERSION: JSON.stringify(version),
},
plugins: [],
});