-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
50 lines (46 loc) · 1006 Bytes
/
vite.config.js
File metadata and controls
50 lines (46 loc) · 1006 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
41
42
43
44
45
46
47
48
49
50
import path from "path";
import { defineConfig, build } from "vite";
const LIB = process.env.LIB ?? "htmlFooter";
// libraries
const libConfig = {
htmlFooter: {
entry: "./src/html-footer.js",
name: "tehFooter"
},
mainReply: {
entry: "./src/main-reply.js",
name: "tehMainReply"
},
optional: {
entry: "./src/optional.js",
name: "tehOptional"
}
};
const currentConfig = libConfig[LIB];
export default defineConfig(() => ({
build: {
target: ["chrome87", "edge88", "firefox78", "safari14"],
sourcemap: false,
minify: false,
emptyOutDir: false,
lib: {
entry: currentConfig.entry,
name: currentConfig.name,
fileName: (format, entryName) => `teh.${entryName}.${format}.js`,
formats: ["iife"]
},
oxc: {
charset: "utf-8"
},
rolldownOptions: {
output: {
generatedCode: {
symbols: false
}
}
},
commonjsOptions: {
transformMixedEsModules: true
}
}
}));