dappconnect-chat-sdk/packages/icons/vite.config.ts

36 lines
717 B
TypeScript
Raw Normal View History

2023-01-17 13:32:04 +00:00
/// <reference types="vitest" />
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import pkg from './package.json'
2023-01-17 13:32:04 +00:00
const external = [
'@tamagui/core', // used for types
// ...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
2023-01-17 13:32:04 +00:00
].map(name => new RegExp(`^${name}(/.*)?`))
export default defineConfig(({ mode }) => {
return {
build: {
target: 'es2020',
lib: {
entry: 'index.ts',
formats: ['es', 'cjs'],
2023-01-17 13:32:04 +00:00
},
sourcemap: true,
emptyOutDir: mode === 'production',
rollupOptions: {
external,
},
},
plugins: [react()],
test: {
environment: 'happy-dom',
},
}
})