2023-06-08 04:41:20 +03:00
|
|
|
import { resolve } from 'node:path';
|
|
|
|
|
|
|
|
import { fileURLToPath } from 'url';
|
2023-08-29 13:07:05 +03:00
|
|
|
import { defineConfig } from 'vite';
|
2023-06-08 04:41:20 +03:00
|
|
|
import dts from 'vite-plugin-dts';
|
|
|
|
|
|
|
|
const root = fileURLToPath(new URL('.', import.meta.url));
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
build: {
|
2023-07-04 19:43:30 +03:00
|
|
|
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'),
|
2023-12-08 06:20:02 +03:00
|
|
|
atom: resolve(root, 'src/atom/index.ts'),
|
2023-09-22 17:31:26 +03:00
|
|
|
command: resolve(root, 'src/command/index.ts'),
|
2023-08-03 11:48:59 +03:00
|
|
|
type: resolve(root, 'src/type.ts'),
|
2023-07-04 19:43:30 +03:00
|
|
|
'core/event-emitter': resolve(root, 'src/core/event-emitter.ts'),
|
|
|
|
'preload/electron': resolve(root, 'src/preload/electron.ts'),
|
2023-08-03 11:48:59 +03:00
|
|
|
'__internal__/workspace': resolve(
|
|
|
|
root,
|
|
|
|
'src/__internal__/workspace.ts'
|
|
|
|
),
|
2023-08-08 03:58:31 +03:00
|
|
|
'__internal__/plugin': resolve(root, 'src/__internal__/plugin.ts'),
|
2023-06-08 04:41:20 +03:00
|
|
|
},
|
|
|
|
formats: ['es', 'cjs'],
|
|
|
|
name: 'AffineInfra',
|
|
|
|
},
|
2023-07-04 19:43:30 +03:00
|
|
|
rollupOptions: {
|
2023-08-03 11:48:59 +03:00
|
|
|
external: [
|
|
|
|
'electron',
|
|
|
|
'async-call-rpc',
|
|
|
|
'rxjs',
|
|
|
|
'zod',
|
|
|
|
'react',
|
2023-08-28 08:31:56 +03:00
|
|
|
'yjs',
|
2023-09-28 05:53:04 +03:00
|
|
|
'nanoid',
|
2023-08-03 11:48:59 +03:00
|
|
|
/^jotai/,
|
|
|
|
/^@blocksuite/,
|
2023-08-10 22:56:16 +03:00
|
|
|
/^@affine\/templates/,
|
2023-08-03 11:48:59 +03:00
|
|
|
],
|
2023-07-04 19:43:30 +03:00
|
|
|
},
|
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
|
|
|
});
|