Files
NapCatQQ/packages/napcat-schema/vite.config.ts
T
手瓜一十雪 974528fe7e Apply formatting and minor style fixes across repo
Normalize code style across multiple packages: whitespace cleanup, consistent commas and trailing commas in arrays/enums/objects, fix table markdown lines in CI comment template, ensure newline at EOF, normalize header/object property quoting and spacing, remove stray blank lines and minor non-functional comment tweaks. These are formatting-only changes and small type/annotation spacing adjustments; no functional behavior changes intended.
2026-03-05 18:45:50 +08:00

49 lines
1.3 KiB
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}`), 'node:sqlite'].flat();
export default defineConfig({
resolve: {
conditions: ['node', 'default'],
alias: {
'@/napcat-rpc': resolve(__dirname, '../napcat-rpc'),
'@/napcat-onebot': resolve(__dirname, '../napcat-onebot'),
'@/napcat-common': resolve(__dirname, '../napcat-common'),
'@/napcat-schema': resolve(__dirname, './src'),
'@/napcat-core': resolve(__dirname, '../napcat-core'),
'@/napcat-webui-backend': resolve(__dirname, '../napcat-webui-backend'),
'@/napcat-image-size': resolve(__dirname, '../napcat-image-size'),
},
},
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,
],
},
},
});