feat: plugin system with isolated bundles (#2660)

(cherry picked from commit 94d20f1bdc)
This commit is contained in:
Himself65
2023-06-02 16:28:47 +08:00
committed by himself65
parent 66653d1d8a
commit bb8bfd0c9e
19 changed files with 147 additions and 28 deletions

View File

@@ -0,0 +1,33 @@
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'
),
},
},
},
});