-
Notifications
You must be signed in to change notification settings - Fork 24
/
vite.config.ts
52 lines (51 loc) · 1.46 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
import { defineConfig } from 'vitest/config';
import dts from 'vite-plugin-dts';
import { resolve } from 'node:path';
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'GridPlusSDK',
fileName: (format) => `gridplus-sdk.${format}.js`,
formats: ['es', 'umd'],
},
rollupOptions: {
external: [
'@ethereumjs/common',
'@ethereumjs/rlp',
'@ethereumjs/tx',
'@ethersproject/abi',
'@metamask/eth-sig-util',
'bn.js',
],
output: {
globals: {
'@ethereumjs/common': 'EthereumjsCommon',
'@ethereumjs/rlp': 'EthereumjsRlp',
'@ethereumjs/tx': 'EthereumjsTx',
'@ethersproject/abi': 'EthersprojectAbi',
'@metamask/eth-sig-util': 'MetamaskEthSigUtil',
'bn.js': 'BN',
},
},
},
sourcemap: true,
minify: false,
},
plugins: [dts()],
test: {
globals: true,
environment: 'node',
include: ['**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
/** connect.test.ts is excluded because it is still a WIP (https://github.com/GridPlus/gridplus-sdk/issues/420) */
exclude: ['./src/__test__/integration/connect.test.ts', './forge'],
testTimeout: 120000,
maxConcurrency: 1,
fileParallelism: false,
setupFiles: ['./src/__test__/utils/setup.ts'],
coverage: {
provider: 'istanbul', // or 'v8'
reporter: ['lcov'],
},
},
});