-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
57 lines (53 loc) · 1.15 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
import { defineConfig } from 'vite'
import type { UserConfig } from 'vitest/config'
import * as path from 'path';
const external = (id: string) => {
if (
id.endsWith('fs') ||
id.endsWith('path') ||
id.endsWith('perf_hooks') ||
id.endsWith('process') ||
id.endsWith('commander') ||
id.endsWith('esbuild')
) {
return true
}
false
}
export const defaultConfig: UserConfig = {
build: {
outDir: 'dist',
lib: {
name: 'unused-i18n',
entry: 'src/cli.ts',
formats: ['cjs'],
fileName: (format, filename) => `${filename}.${format}`,
},
rollupOptions: {
external,
preserveSymlinks: true,
input: 'src/cli.ts',
output: {
banner: '#!/usr/bin/env node',
interop: 'compat',
manualChunks: {},
},
},
},
plugins: [],
test: {
globals: true,
environment: 'node',
coverage: {
provider: 'istanbul',
reporter: ['text', 'json', 'html'],
},
},
resolve: {
alias: {
'@utils': path.resolve(__dirname, 'src/utils'),
'@lib': path.resolve(__dirname, 'src/lib'),
},
},
}
export default defineConfig(defaultConfig)