82 lines
1.7 KiB
JavaScript
82 lines
1.7 KiB
JavaScript
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig({
|
|
plugins: [sveltekit()],
|
|
define: {
|
|
global: 'globalThis'
|
|
},
|
|
optimizeDeps: {
|
|
exclude: [
|
|
'@creit.tech/stellar-wallets-kit',
|
|
'@stellar/freighter-api',
|
|
'@lobstrco/signer-extension-api',
|
|
'@stellar/typescript-wallet-sdk-km'
|
|
]
|
|
},
|
|
ssr: {
|
|
noExternal: []
|
|
}
|
|
});
|
|
define: {
|
|
global: 'globalThis'
|
|
},
|
|
optimizeDeps: {
|
|
include: [
|
|
'@stellar/stellar-sdk'
|
|
],
|
|
exclude: [
|
|
'@stellar/typescript-wallet-sdk-km',
|
|
'@creit.tech/stellar-wallets-kit',
|
|
'@stellar/freighter-api',
|
|
'@lobstrco/signer-extension-api'
|
|
]
|
|
},
|
|
resolve: {
|
|
dedupe: ['svelte']
|
|
},
|
|
ssr: {
|
|
noExternal: [],
|
|
external: [
|
|
'@stellar/freighter-api',
|
|
'@creit.tech/stellar-wallets-kit',
|
|
'@lobstrco/signer-extension-api'
|
|
]
|
|
},
|
|
server: {
|
|
fs: {
|
|
// Allow serving files from one level up to the project root
|
|
allow: ['..']
|
|
},
|
|
hmr: {
|
|
overlay: false
|
|
}
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: (id) => {
|
|
// Group stellar wallets kit and related APIs into their own chunk
|
|
if (id.includes('@creit.tech/stellar-wallets-kit') ||
|
|
id.includes('@stellar/freighter-api') ||
|
|
id.includes('@lobstrco/signer-extension-api') ||
|
|
id.includes('@stellar/typescript-wallet-sdk-km')) {
|
|
return 'wallets-kit';
|
|
}
|
|
// Group lit components into their own chunk
|
|
if (id.includes('lit') && !id.includes('stellar')) {
|
|
return 'lit-components';
|
|
}
|
|
// Group large dependencies
|
|
if (id.includes('node_modules')) {
|
|
return 'vendor';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
test: {
|
|
include: ['src/**/*.{test,spec}.{js,ts}']
|
|
}
|
|
});
|