mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix
This commit is contained in:
parent
e34b60315c
commit
25751b8149
@ -3,14 +3,12 @@ import { defineConfig, PluginOption, UserConfig } from 'vite';
|
|||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
import nodeResolve from '@rollup/plugin-node-resolve';
|
import nodeResolve from '@rollup/plugin-node-resolve';
|
||||||
import { builtinModules } from 'module';
|
import { builtinModules } from 'module';
|
||||||
|
//依赖排除
|
||||||
const external = ['silk-wasm', 'ws', 'express', 'qrcode-terminal', 'fluent-ffmpeg', 'piscina'];
|
const external = ['silk-wasm', 'ws', 'express', 'qrcode-terminal', 'fluent-ffmpeg'];
|
||||||
const nodeModules = [...builtinModules, builtinModules.map(m => `node:${m}`)].flat();
|
const nodeModules = [...builtinModules, builtinModules.map((m) => `node:${m}`)].flat();
|
||||||
|
|
||||||
function genCpModule(module: string) {
|
function genCpModule(module: string) {
|
||||||
return { src: `./node_modules/${module}`, dest: `dist/node_modules/${module}`, flatten: false };
|
return { src: `./node_modules/${module}`, dest: `dist/node_modules/${module}`, flatten: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
let startScripts: string[] | undefined = undefined;
|
let startScripts: string[] | undefined = undefined;
|
||||||
if (process.env.NAPCAT_BUILDSYS == 'linux') {
|
if (process.env.NAPCAT_BUILDSYS == 'linux') {
|
||||||
startScripts = [];
|
startScripts = [];
|
||||||
@ -19,7 +17,6 @@ if (process.env.NAPCAT_BUILDSYS == 'linux') {
|
|||||||
} else {
|
} else {
|
||||||
startScripts = ['./script/KillQQ.bat'];
|
startScripts = ['./script/KillQQ.bat'];
|
||||||
}
|
}
|
||||||
|
|
||||||
const FrameworkBaseConfigPlugin: PluginOption[] = [
|
const FrameworkBaseConfigPlugin: PluginOption[] = [
|
||||||
cp({
|
cp({
|
||||||
targets: [
|
targets: [
|
||||||
@ -68,14 +65,14 @@ const ShellBaseConfig = () =>
|
|||||||
target: 'esnext',
|
target: 'esnext',
|
||||||
minify: false,
|
minify: false,
|
||||||
lib: {
|
lib: {
|
||||||
entry: {
|
entry: 'src/shell/napcat.ts',
|
||||||
'napcat': 'src/shell/napcat.ts',
|
|
||||||
'audio-worker': 'src/common/audio-worker.ts',
|
|
||||||
},
|
|
||||||
formats: ['es'],
|
formats: ['es'],
|
||||||
fileName: (_, entryName) => `${entryName}.mjs`,
|
fileName: () => 'napcat.mjs',
|
||||||
}
|
},
|
||||||
}
|
rollupOptions: {
|
||||||
|
external: [...nodeModules, ...external],
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const FrameworkBaseConfig = () =>
|
const FrameworkBaseConfig = () =>
|
||||||
@ -93,14 +90,14 @@ const FrameworkBaseConfig = () =>
|
|||||||
target: 'esnext',
|
target: 'esnext',
|
||||||
minify: false,
|
minify: false,
|
||||||
lib: {
|
lib: {
|
||||||
entry: {
|
entry: 'src/framework/napcat.ts',
|
||||||
'napcat': 'src/framework/napcat.ts',
|
|
||||||
'audio-worker': 'src/common/audio-worker.ts',
|
|
||||||
},
|
|
||||||
formats: ['es'],
|
formats: ['es'],
|
||||||
fileName: (_, entryName) => `${entryName}.mjs`,
|
fileName: () => 'napcat.mjs',
|
||||||
},
|
},
|
||||||
}
|
rollupOptions: {
|
||||||
|
external: [...nodeModules, ...external],
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default defineConfig(({ mode }): UserConfig => {
|
export default defineConfig(({ mode }): UserConfig => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user