-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
54 lines (53 loc) · 1.28 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
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import tsconfigPaths from 'vite-tsconfig-paths'
import { resolve } from 'path'
import { typescriptPaths } from 'rollup-plugin-typescript-paths'
import typescript from '@rollup/plugin-typescript'
// https://vitejs.dev/config https://vitest.dev/config
export default defineConfig({
plugins: [/*wasm(), */ react(), tsconfigPaths()],
test: {
globals: true,
environment: 'happy-dom'
},
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
stream: 'stream-browserify'
}
},
build: {
minify: true,
reportCompressedSize: true,
lib: {
entry: resolve(__dirname, 'src/main.ts'),
formats: ['es'],
fileName: 'main'
},
rollupOptions: {
external: [
'react',
'react-dom',
'@bitcoinerlab/secp256k1',
'@cosmjs/stargate',
'@keystonehq/animated-qr',
'@keystonehq/keystone-sdk',
'@keystonehq/sdk',
'@scure/bip32',
'bitcoinjs-lib'
],
plugins: [
typescriptPaths({
preserveExtensions: true
}),
typescript({
sourceMap: false,
declaration: true,
outDir: 'dist'
})
]
}
}
})