-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
60 lines (56 loc) · 1.53 KB
/
vite.config.ts
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
/// <reference types="vitest" />
import path from "path";
import { defineConfig } from "vite";
import dts from 'vite-plugin-dts';
const root_path = (p?: string): string => path.join(__dirname, p ?? '');
const js_path = (p?: string): string => path.join(root_path('js'), p ?? '');
const common_exclude = [
'node_modules/**',
'vendor/**',
'dist/**',
];
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export default defineConfig(({ mode }) => {
return {
plugins: [
dts({
entryRoot: js_path(),
strictOutput: true,
exclude: [],
insertTypesEntry: true,
}),
],
resolve: {
alias: {
'@': js_path(''),
'tests': root_path('tests/js'),
},
},
build: {
minify: true,
reportCompressedSize: true,
lib: {
entry: js_path('index.ts'),
name: "Ziglite",
fileName: "index",
formats: ["es"],
},
rollupOptions: {
external: ['qs', 'zod'],
},
},
test: {
include: [
'**/tests/js/**/*.test.ts',
],
exclude: common_exclude,
typecheck: {
enabled: true,
include: [
'**/tests/js/**/*.test-d.ts',
],
exclude: common_exclude,
},
},
};
});