-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.bootstrap.ts
More file actions
40 lines (39 loc) · 942 Bytes
/
vite.config.bootstrap.ts
File metadata and controls
40 lines (39 loc) · 942 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
30
31
32
33
34
35
36
37
38
39
40
import { resolve } from "node:path";
import { defineConfig } from "vite";
export default defineConfig({
resolve: {
alias: {
"@": resolve(__dirname, "./src"),
},
},
build: {
outDir: "dist/bootstrap",
lib: {
entry: resolve(__dirname, "src/bootstrap/index.ts"),
name: "PaymentWidgetBootstrap",
fileName: (format) =>
`widget-bootstrap.v1.min.${format === "umd" ? "js" : format}`,
formats: ["umd"],
},
rollupOptions: {
output: {
inlineDynamicImports: true,
},
},
minify: "terser",
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
},
mangle: true,
},
},
define: {
"process.env.NODE_ENV": '"production"',
// Permite override da CDN URL via variável de ambiente
"import.meta.env.VITE_CDN_BASE_URL": JSON.stringify(
process.env.VITE_CDN_BASE_URL || ""
),
},
});