-
Notifications
You must be signed in to change notification settings - Fork 40
/
vite.config.ts
41 lines (39 loc) · 951 Bytes
/
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
/// <reference types="vitest" />
import path from 'node:path';
import { defineConfig } from 'vite';
import pkg from './package.json';
// https://vitejs.dev/config/
export default defineConfig({
define: {
'process.env.NODE_ENV': '"production"',
__VERSION__: JSON.stringify(pkg.version),
},
build: {
minify: true,
target: 'esnext',
lib: {
entry: path.resolve(__dirname, 'src/main.ts'),
name: 'sdk',
fileName: (format) => `main.${format}.js`,
},
rollupOptions: {
onwarn: (warning, warn) => {
if (warning.code === 'EVAL') {
return;
}
warn(warning);
},
},
},
test: {
mockReset: true,
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/cypress/**',
'**/.{idea,git,cache,output,temp}/**',
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
'**/e2e/**',
],
},
});