zip-webpack-plugin icon indicating copy to clipboard operation
zip-webpack-plugin copied to clipboard

Zip an entire directory

Open Zedonboy opened this issue 5 years ago • 7 comments

Is there anyway i can zip a directory example "dist" directory?

Zedonboy avatar Aug 19 '18 11:08 Zedonboy

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 avatar Dec 10 '18 10:12 shnigi

@shnigi were you able to find a solution for your problem? I'm also trying to do that. Thanks in advance

fabiankaegy avatar Mar 04 '19 05:03 fabiankaegy

Also would like to know here. Seems a very natural use-case for a zip plugin.

rob2d avatar Mar 21 '19 16:03 rob2d

Also interested

m1guelpf avatar Jun 19 '19 16:06 m1guelpf

You can zip a directory using the "includes" regex.

E.g include: [/dist\/.*/],

Unfortunately, it also includes the dist folder in the archive.

StanLindsey avatar Jul 26 '19 11:07 StanLindsey

Its possible to compress a directory outside webpack dist?

For example

|- my_webpack_app <--- compress from here . |- dist . |- assets . |- js . |- css

AlonsoK28 avatar Apr 15 '20 04:04 AlonsoK28

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"
},

ouweiya avatar May 07 '22 12:05 ouweiya