status-web/packages/status-react/vite.config.ts

40 lines
783 B
TypeScript
Raw Permalink Normal View History

/// <reference types="vitest" />
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { dependencies, peerDependencies } from './package.json'
const external = [
...Object.keys(dependencies || {}),
...Object.keys(peerDependencies || {}),
].map(name => new RegExp(`^${name}(/.*)?`))
2022-06-28 14:54:21 +00:00
export default defineConfig(({ mode }) => {
return {
build: {
2022-06-28 14:54:21 +00:00
target: 'es2020',
lib: {
entry: './src/index.tsx',
fileName: 'index',
formats: ['es'],
},
2022-06-28 14:54:21 +00:00
sourcemap: true,
emptyOutDir: mode === 'production',
rollupOptions: {
external,
},
},
plugins: [
react({
// jsxRuntime: 'classic',
}),
],
test: {
environment: 'happy-dom',
},
}
})