How to zip your files using npm or yarn

I have been building a WordPress plugin for a client. Whenever I want to upload the latest version, I need to zip the entires plugin codebase and upload the zip file in the WordPress dashboard.

After several manual works, it started to piss me off. So, I do some quick googling and found out you can run zip command in terminal. Not sure if its works on Windows 😕.

Add this command in the package.json . You can run npm run generate or yarn generate

 "scripts": {
 	"generate": "zip -r mta-performance.zip ./*",
 }

Another solution would be to use gulp or any other tooling. I'm lazy to set up all these things, I used the native commands.

I send out my writing and ideas every week to my mailing list

Great! Check your inbox and click the link to confirm your subscription
Please enter a valid email address!