Files
AFFiNE-Mirror/plugins/bookmark-block/vite.config.ts
Himself65 bb8bfd0c9e feat: plugin system with isolated bundles (#2660)
(cherry picked from commit 94d20f1bdc)
2023-06-08 18:19:03 +08:00

34 lines
687 B
TypeScript

import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vite';
const rootDir = fileURLToPath(new URL('.', import.meta.url));
export default defineConfig({
build: {
minify: false,
lib: {
entry: resolve(__dirname, 'src/server.ts'),
fileName: 'server',
formats: ['cjs'],
},
emptyOutDir: true,
rollupOptions: {
external: ['cheerio', 'electron', 'node:url'],
output: {
dir: resolve(
rootDir,
'..',
'..',
'apps',
'electron',
'dist',
'plugins',
'bookmark-block'
),
},
},
},
});