52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import { defineConfig } from 'vitest/config';
|
|
import react from '@vitejs/plugin-react';
|
|
import { resolve } from 'node:path';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
build: {
|
|
lib: {
|
|
entry: {
|
|
index: resolve(__dirname, 'src/index.ts'),
|
|
'components/MDXEditorField': resolve(
|
|
__dirname,
|
|
'src/components/MDXEditorField.tsx',
|
|
),
|
|
},
|
|
name: 'PanicWebUi',
|
|
formats: ['es'],
|
|
fileName: (_format, entryName) => `${entryName}.js`,
|
|
},
|
|
rollupOptions: {
|
|
external: [
|
|
'react',
|
|
'react-dom',
|
|
'react-router-dom',
|
|
'@heroicons/react',
|
|
'@mdxeditor/editor',
|
|
],
|
|
},
|
|
},
|
|
test: {
|
|
environment: 'jsdom',
|
|
setupFiles: ['./tests/setup.ts'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
include: ['src/**/*.{ts,tsx}'],
|
|
exclude: [
|
|
'src/**/*.story.{ts,tsx}',
|
|
'src/**/*.stories.{ts,tsx}',
|
|
'src/index.ts',
|
|
'src/styles/**',
|
|
'src/components/types.ts',
|
|
'src/types/**',
|
|
],
|
|
thresholds: {
|
|
lines: 95,
|
|
functions: 95,
|
|
branches: 90,
|
|
},
|
|
},
|
|
},
|
|
});
|