import JSZip from 'node-zip' ; import fs from 'fs' ; import packageJson from '../package.json' ; const FILES = [ 'manifest.json' , 'dist/src/index.js' , 'dist/src/auto-clicker.js' , 'resources/16.png' , 'resources/48.png' , 'resources/96.png' , 'resources/128.png' ] ; function run ( ) { try { console . log ( '🔥 Starting build' ) ; if ( ! fs . existsSync ( 'build' ) ) { fs . mkdirSync ( 'build' ) ; } const zip = new JSZip ( ) ; for ( let file of FILES ) { zip . file ( file , fs . readFileSync ( file ) ) ; } const data = zip . generate ( { type : 'nodebuffer' } ) ; fs . writeFileSync ( `build/${ packageJson . name }.zip` , data ) ; console . log ( '🚀 Build finished' ) ; } catch ( error ) { console . error ( error . message ) ; } } run ( ) ;