refactor: use esbuild instead of vite (#2672)

(cherry picked from commit acda594cba)
This commit is contained in:
Himself65
2023-06-02 21:22:09 +08:00
committed by himself65
parent bb8bfd0c9e
commit 42c7c367ab
13 changed files with 111 additions and 80 deletions

View File

@@ -7,10 +7,6 @@
".": "./src/index.ts",
"./server": "./src/server.ts"
},
"scripts": {
"build": "vite build",
"dev": "vite build --watch"
},
"dependencies": {
"@toeverything/plugin-infra": "workspace:*",
"cheerio": "^1.0.0-rc.12"

View File

@@ -1,10 +0,0 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"outDir": "lib"
},
"include": ["vite.config.ts", "scripts"]
}

View File

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