AFFiNE/packages/infra/vite.config.ts

45 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-06-08 04:41:20 +03:00
import { resolve } from 'node:path';
import { fileURLToPath } from 'url';
import dts from 'vite-plugin-dts';
import { defineConfig } from 'vitest/config';
const root = fileURLToPath(new URL('.', import.meta.url));
export default defineConfig({
build: {
minify: false,
2023-06-08 04:41:20 +03:00
lib: {
entry: {
2023-08-10 22:56:16 +03:00
blocksuite: resolve(root, 'src/blocksuite/index.ts'),
2023-06-08 04:41:20 +03:00
index: resolve(root, 'src/index.ts'),
atom: resolve(root, 'src/atom.ts'),
type: resolve(root, 'src/type.ts'),
'core/event-emitter': resolve(root, 'src/core/event-emitter.ts'),
'preload/electron': resolve(root, 'src/preload/electron.ts'),
'__internal__/workspace': resolve(
root,
'src/__internal__/workspace.ts'
),
'__internal__/react': resolve(root, 'src/__internal__/react.ts'),
'__internal__/plugin': resolve(root, 'src/__internal__/plugin.ts'),
2023-06-08 04:41:20 +03:00
},
formats: ['es', 'cjs'],
name: 'AffineInfra',
},
rollupOptions: {
external: [
'electron',
'async-call-rpc',
'rxjs',
'zod',
'react',
/^jotai/,
/^@blocksuite/,
2023-08-10 22:56:16 +03:00
/^@affine\/templates/,
],
},
2023-06-08 04:41:20 +03:00
},
2023-07-18 19:53:10 +03:00
plugins: [dts()],
2023-06-08 04:41:20 +03:00
});