Browse Source

zip.js文件

yangc 8 years ago
parent
commit
f6632f530f
1 changed files with 14 additions and 0 deletions
  1. 14 0
      build/zip.js

+ 14 - 0
build/zip.js

@@ -0,0 +1,14 @@
+var fs = require('fs')
+var path = require('path')
+var archiver = require('archiver')
+
+var output = fs.createWriteStream(path.join(__dirname, '../dist.zip'))
+var archive = archiver('zip')
+
+archive.on('error', function (err) {
+  throw err
+})
+
+archive.pipe(output)
+archive.directory(path.join(__dirname, '../dist/'), '')
+archive.finalize()