forked from Obiajulu-gif/Prompt-Hash-Stellar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.mjs
More file actions
57 lines (51 loc) · 1.5 KB
/
Copy pathvitest.config.mjs
File metadata and controls
57 lines (51 loc) · 1.5 KB
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 'vitest/config'
import react from '@vitejs/plugin-react'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import path from 'path'
import { fileURLToPath } from 'url'
import { createRequire } from 'module'
// Standard ESM fix for __dirname and require
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const require = createRequire(import.meta.url)
export default defineConfig({
plugins: [
react(),
nodePolyfills({ include: ['buffer'] }),
],
optimizeDeps: {
exclude: ['@creit.tech/stellar-wallets-kit'],
include: ['@stellar/stellar-sdk', 'buffer'],
},
build: {
commonjsOptions: {
// This allows the "require" based code inside the kit to work in the browser
include: [/@creit.tech\/stellar-wallets-kit/, /node_modules/],
transformMixedEsModules: true,
},
},
test: {
environment: 'jsdom',
globals: true,
setupFiles: './src/test/setup.ts',
server: {
deps: {
inline: [/@creit\.tech\/stellar-wallets-kit/, /libsodium-wrappers/],
}
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'libsodium-wrappers': require.resolve('libsodium-wrappers'),
inline: [/@creit.tech\/stellar-wallets-kit/, /libsodium-wrappers/],
}
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'libsodium-wrappers': require.resolve('libsodium-wrappers/dist/modules-esm/libsodium.mjs'),
},
},
})