zip-webpack-plugin
zip-webpack-plugin copied to clipboard
Zip an entire directory
Is there anyway i can zip a directory example "dist" directory?
How can I include files that are not generated by webpack to the final zip file? I just want to zip my whole dist dir.
@shnigi were you able to find a solution for your problem? I'm also trying to do that. Thanks in advance
Also would like to know here. Seems a very natural use-case for a zip plugin.
Also interested
You can zip a directory using the "includes" regex.
E.g include: [/dist\/.*/],
Unfortunately, it also includes the dist
folder in the archive.
Its possible to compress a directory outside webpack dist
?
For example
|- my_webpack_app <--- compress from here
. |- dist
. |- assets
. |- js
. |- css
Done using node.
npm i rimraf
install 7z (https://www.7-zip.org/)
zip.js
const rimraf = require('rimraf');
const exec = require('child_process').exec;
rimraf.sync('./zip/*');
exec(`7z.exe a ./zip/FileName.zip ./dist/*`);
npm
"scripts": {
"zip": "node ./zip.js"
},