-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
executable file
·53 lines (51 loc) · 1.58 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
/// <reference types="vitest" />
/// <reference types="vite/client" />
import { defineConfig } from 'vite';
import { resolve } from 'node:path';
import biomePlugin from 'vite-plugin-biome';
import tsconfigPaths from 'vite-tsconfig-paths';
// eslint-disable-next-line no-restricted-syntax
export default defineConfig(({mode}) => {
return ({
clearScreen: false,
resolve: {
alias: {
'~': resolve(__dirname, 'src'),
},
},
plugins: [
// @ts-ignore
mode === 'test' ? undefined : biomePlugin(),
tsconfigPaths()
],
//todo(dawiidio): move build from tsc to vite
build: {
target: 'node22',
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'pli',
formats: ['cjs']
},
outDir: 'lib',
rollupOptions: {
external: (id) => !id.startsWith('.') && !id.startsWith('/'), // Externalize all non-relative modules
output: {
format: 'cjs', // Use 'es' for ES Modules
},
}
},
test: {
exclude: ['examples/**/*', 'templates/**/*', 'test', 'node_modules', 'lib'],
globals: true,
reporters: 'default',
environment: 'node',
setupFiles: [],
coverage: {
reporter: ['text', 'json', 'html'],
},
alias: {
'~': resolve(__dirname, 'src'),
},
},
})
});