mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-04 06:31:13 +00:00
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.
43 lines
926 B
TypeScript
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
|
|
]
|
|
},
|
|
},
|
|
});
|