-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathvite.config.ts
More file actions
60 lines (58 loc) · 1.73 KB
/
Copy pathvite.config.ts
File metadata and controls
60 lines (58 loc) · 1.73 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { defineConfig } from "vite-plus";
const minifyOptions = {
compress: true,
// Keep class/function names during minification. Bundled deps such as
// @actions/cache branch on `error.name === SomeError.name` (e.g.
// ReserveCacheError). Plain `minify: true` mangles the class binding, so
// `SomeError.name` becomes the mangled identifier and never matches the
// instance's preserved `this.name` literal — routing benign errors (like a
// cache reserve race in a build matrix) to core.warning instead of core.info.
mangle: { keepNames: { function: true, class: true } },
};
export default defineConfig({
test: {
include: ["src/**/*.test.ts"],
},
staged: {
"*": "vp check --fix",
},
// Build each entry independently so the portable CI runtimes remain
// standalone files. A shared chunk would not be present when GitLab or
// Azure downloads only its entrypoint from raw.githubusercontent.com.
pack: [
{
entry: { index: "./src/index.ts" },
format: ["esm"],
outDir: "dist",
deps: { alwaysBundle: [/.*/], onlyBundle: false },
clean: true,
minify: minifyOptions,
},
{
entry: { "gitlab/index": "./src/gitlab/index.ts" },
format: ["esm"],
outDir: "dist",
deps: { alwaysBundle: [/.*/], onlyBundle: false },
clean: false,
minify: minifyOptions,
},
{
entry: { "azure/index": "./src/azure/index.ts" },
format: ["esm"],
outDir: "dist",
deps: { alwaysBundle: [/.*/], onlyBundle: false },
clean: false,
minify: minifyOptions,
},
],
lint: {
ignorePatterns: ["dist/**/*"],
options: {
typeAware: true,
typeCheck: true,
},
},
fmt: {
ignorePatterns: ["dist/**/*"],
},
});