@@ -20,55 +20,42 @@ const nodeModules = [...builtinModules, builtinModules.map(m => `node:${m}`)].fl
2020function genCpModule ( module : string ) {
2121 return { src : `./node_modules/${ module } ` , dest : `dist/node_modules/${ module } ` , flatten : false } ;
2222}
23- const systemPlatform = os . platform ( ) ;
2423let startScripts : string [ ] | undefined = undefined ;
25- let baseConfigPlugin : PluginOption [ ] | undefined = undefined ;
26- if ( systemPlatform == "linux" ) {
24+ let MoeHooModule : any = [ ] ;
25+ if ( process . env . NAPCAT_BUILDSYS == "linux" ) {
26+ if ( process . env . NAPCAT_BUILDARCH == "x64" ) {
27+ MoeHooModule = [ { src : './src/core.lib/MoeHoo-linux-x64.node' , dest : 'dist' } ] ;
28+ }
2729 startScripts = [ './script/napcat.sh' ] ;
28- baseConfigPlugin = [
29- // PreprocessorDirectives(),
30- cp ( {
31- targets : [
32- // ...external.map(genCpModule),
33- { src : './src/napcat.json' , dest : 'dist/config/' } ,
34- { src : './src/onebot11/onebot11.json' , dest : 'dist/config/' } ,
35- { src : './package.json' , dest : 'dist' } ,
36- { src : './README.md' , dest : 'dist' } ,
37- { src : './logo.png' , dest : 'dist/logs' } ,
38- { src : './src/core.lib/MoeHoo-linux-x64.node' , dest : 'dist' } ,
39- ...( startScripts . map ( ( startScript ) => {
40- return { src : startScript , dest : 'dist' } ;
41- } ) ) ,
42- ]
43- } ) ,
44- nodeResolve ( ) ,
45- commonjs ( ) ,
46- ] ;
47- } else {
30+ } else if ( process . env . NAPCAT_BUILDSYS == "win32" ) {
31+ if ( process . env . NAPCAT_BUILDARCH == "x64" ) {
32+ MoeHooModule = [ { src : './src/core.lib/MoeHoo-win32-x64.node' , dest : 'dist' } ] ;
33+ }
4834 startScripts = [ './script/napcat.ps1' , './script/napcat.bat' , './script/napcat-utf8.bat' , './script/napcat-utf8.ps1' , './script/napcat-log.ps1' ] ;
49- baseConfigPlugin = [
50- // PreprocessorDirectives(),
51- cp ( {
52- targets : [
53- // ...external.map(genCpModule),
54- { src : './src/napcat.json' , dest : 'dist/config/' } ,
55- { src : './src/onebot11/onebot11.json' , dest : 'dist/config/' } ,
56- { src : './package.json' , dest : 'dist' } ,
57- { src : './README.md' , dest : 'dist' } ,
58- { src : './logo.png' , dest : 'dist/logs' } ,
59- { src : './src/core.lib/MoeHoo-win32-x64.node' , dest : 'dist' } ,
60- ...( startScripts . map ( ( startScript ) => {
61- return { src : startScript , dest : 'dist' } ;
62- } ) ) ,
63- ]
64- } ) ,
65- nodeResolve ( ) ,
66- commonjs ( ) ,
67- ] ;
68-
35+ } else {
36+ MoeHooModule = [ { src : './src/core.lib/MoeHoo-win32-x64.node' , dest : 'dist' } , { src : './src/core.lib/MoeHoo-linux-x64.node' , dest : 'dist' } ] ;
37+ startScripts = [ './script/napcat.sh' , './script/napcat.ps1' , './script/napcat.bat' , './script/napcat-utf8.bat' , './script/napcat-utf8.ps1' , './script/napcat-log.ps1' ] ;
6938}
7039
71-
40+ let baseConfigPlugin : PluginOption [ ] = [
41+ // PreprocessorDirectives(),
42+ cp ( {
43+ targets : [
44+ // ...external.map(genCpModule),
45+ { src : './src/napcat.json' , dest : 'dist/config/' } ,
46+ { src : './src/onebot11/onebot11.json' , dest : 'dist/config/' } ,
47+ { src : './package.json' , dest : 'dist' } ,
48+ { src : './README.md' , dest : 'dist' } ,
49+ { src : './logo.png' , dest : 'dist/logs' } ,
50+ ...MoeHooModule ,
51+ ...( startScripts . map ( ( startScript ) => {
52+ return { src : startScript , dest : 'dist' } ;
53+ } ) ) ,
54+ ]
55+ } ) ,
56+ nodeResolve ( ) ,
57+ commonjs ( ) ,
58+ ] ;
7259// if (os.platform() !== 'win32') {
7360// startScripts = ['./script/napcat.sh'];
7461// }
0 commit comments