dappconnect-sdks/packages/icons/vite.config.ts

40 lines
763 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 { peerDependencies } from './package.json'
const external = [
// ...Object.keys(dependencies || {}),
...Object.keys(peerDependencies || {}),
].map(name => new RegExp(`^${name}(/.*)?`))
export default defineConfig(({ mode }) => {
return {
build: {
target: 'es2020',
lib: {
entry: './src/index.tsx',
fileName: 'index',
formats: ['es'],
},
sourcemap: true,
emptyOutDir: mode === 'production',
rollupOptions: {
external,
},
},
plugins: [react()],
// plugins: [
// react(),
// ],
test: {
environment: 'happy-dom',
},
}
})