-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
56 lines (50 loc) · 1.07 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
import { builtinModules } from "module";
import { defineConfig } from "vitest/config";
const config: any = {
lib: {
entry: [
"src/index.ts"
],
fileName: "index",
name: "correios-api-client",
},
example: {
entry:[
"src/example/example.ts"
],
fileName: "example",
name: "correios-api-client-example",
},
};
const currentConfig = process.env.LIB_NAME != null
? config[process.env.LIB_NAME]
: config.lib;
export default defineConfig({
build: {
target: "es2022",
lib: {
...currentConfig,
},
commonjsOptions: {
ignore: [...builtinModules],
},
sourcemap: true,
outDir: "dist",
emptyOutDir: false,
minify: false,
},
test: {
globals: true,
threads: false,
setupFiles: "tests/setup.ts",
logHeapUsage: true,
},
resolve: {
alias: {}
}
});
namespace NodeJS {
export interface ProcessEnv {
LIB_NAME?: string;
}
}