NapCatQQ/packages/napcat-schema/vite.config.ts
手瓜一十雪 65bae6b57a
Some checks are pending
Build NapCat Artifacts / Build-Framework (push) Waiting to run
Build NapCat Artifacts / Build-Shell (push) Waiting to run
Introduce NapCat Protocol and adapter management
Added the new napcat-protocol package with protocol config, event, API, and network management modules. Introduced napcat-adapter package to unify protocol adapter management, replacing direct OneBot usage in framework and shell. Updated napcat-framework and napcat-shell to use NapCatAdapterManager for protocol initialization and registration. Adjusted dependencies and Vite configs to include new packages.
2026-01-29 22:14:55 +08:00

43 lines
926 B
TypeScript

import { defineConfig } from 'vite';
import path, { resolve } from 'path';
import { builtinModules } from 'module';
import nodeResolve from '@rollup/plugin-node-resolve';
import napcatVersion from 'napcat-vite/vite-plugin-version';
// 依赖排除
const external = [
'ws',
'express',
'electron'
];
const nodeModules = [...builtinModules, builtinModules.map((m) => `node:${m}`)].flat();
export default defineConfig({
resolve: {
conditions: ['node', 'default'],
alias: {
'@/': resolve(__dirname, '../'),
},
},
plugins: [
nodeResolve(),
napcatVersion()
],
build: {
target: 'esnext',
minify: false,
emptyOutDir: true,
outDir: 'dist',
lib: {
entry: path.resolve(__dirname, './index.ts'),
formats: ['es'],
fileName: () => 'schemas.mjs',
},
rollupOptions: {
external: [
...nodeModules,
...external
]
},
},
});