-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathvite.config.ts
More file actions
40 lines (39 loc) · 1.06 KB
/
Copy pathvite.config.ts
File metadata and controls
40 lines (39 loc) · 1.06 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
import { defineConfig } from "vite-plus";
export default defineConfig({
test: {
include: ["src/**/*.test.ts"],
},
staged: {
"*": "vp check --fix",
},
pack: {
entry: ["./src/index.ts"],
format: ["esm"],
outDir: "dist",
deps: {
alwaysBundle: [/.*/],
onlyBundle: false,
},
clean: 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.
minify: {
compress: true,
mangle: { keepNames: { function: true, class: true } },
},
},
lint: {
ignorePatterns: ["dist/**/*"],
options: {
typeAware: true,
typeCheck: true,
},
},
fmt: {
ignorePatterns: ["dist/**/*"],
},
});