Revert "chore: optimize vite.config.ts"

This reverts commit 6a0d592491.
This commit is contained in:
Wesley F. Young 2024-09-04 10:38:10 +08:00
parent d76a1305e7
commit 4a11ebc9b9

View File

@ -8,11 +8,18 @@ import babel from 'vite-plugin-babel';
//依赖排除 //依赖排除
const external = ['silk-wasm', 'ws', 'express', 'fluent-ffmpeg', 'log4js', 'qrcode-terminal']; const external = ['silk-wasm', 'ws', 'express', 'fluent-ffmpeg', 'log4js', 'qrcode-terminal'];
const nodeModules = [...builtinModules, builtinModules.map(m => `node:${m}`)].flat(); const nodeModules = [...builtinModules, builtinModules.map(m => `node:${m}`)].flat();
function genCpModule(module: string) {
return { src: `./node_modules/${module}`, dest: `dist/node_modules/${module}`, flatten: false };
}
let startScripts: string[] | undefined; let startScripts: string[] | undefined = undefined;
if (process.env.NAPCAT_BUILDSYS == 'linux') { if (process.env.NAPCAT_BUILDSYS == 'linux') {
if (process.env.NAPCAT_BUILDARCH == 'x64') {
}
startScripts = ['./script/napcat.sh']; startScripts = ['./script/napcat.sh'];
} else if (process.env.NAPCAT_BUILDSYS == 'win32') { } else if (process.env.NAPCAT_BUILDSYS == 'win32') {
if (process.env.NAPCAT_BUILDARCH == 'x64') {
}
startScripts = ['./script/BootWay05.ps1', './script/dbghelp.dll', startScripts = ['./script/BootWay05.ps1', './script/dbghelp.dll',
'./script/BootWay05_init.bat', './script/BootWay05_run.bat', './script/BootWay05_run.utf8.bat', './script/KillQQ.bat']; './script/BootWay05_init.bat', './script/BootWay05_run.bat', './script/BootWay05_run.utf8.bat', './script/KillQQ.bat'];
} else { } else {
@ -101,7 +108,7 @@ const ShellBaseConfig = () => defineConfig({
lib: { lib: {
entry: 'src/shell/napcat.ts', entry: 'src/shell/napcat.ts',
formats: ['es'], formats: ['es'],
fileName: 'napcat.mjs', fileName: () => 'napcat.mjs',
}, },
rollupOptions: { rollupOptions: {
external: [...nodeModules, ...external], external: [...nodeModules, ...external],
@ -125,7 +132,7 @@ const FrameworkBaseConfig = () => defineConfig({
lib: { lib: {
entry: 'src/framework/napcat.ts', entry: 'src/framework/napcat.ts',
formats: ['es'], formats: ['es'],
fileName: 'napcat.mjs', fileName: () => 'napcat.mjs',
}, },
rollupOptions: { rollupOptions: {
external: [...nodeModules, ...external], external: [...nodeModules, ...external],