Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

filemanager-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filemanager-webpack-plugin - npm Package Compare versions

Comparing version 1.0.21 to 1.0.22

lib/index.js.map

163

lib/index.js

@@ -13,119 +13,8 @@ 'use strict';

var asyncGenerator = function () {
function AwaitValue(value) {
this.value = value;
}
function AsyncGenerator(gen) {
var front, back;
function send(key, arg) {
return new Promise(function (resolve, reject) {
var request = {
key: key,
arg: arg,
resolve: resolve,
reject: reject,
next: null
};
if (back) {
back = back.next = request;
} else {
front = back = request;
resume(key, arg);
}
});
}
function resume(key, arg) {
try {
var result = gen[key](arg);
var value = result.value;
if (value instanceof AwaitValue) {
Promise.resolve(value.value).then(function (arg) {
resume("next", arg);
}, function (arg) {
resume("throw", arg);
});
} else {
settle(result.done ? "return" : "normal", result.value);
}
} catch (err) {
settle("throw", err);
}
}
function settle(type, value) {
switch (type) {
case "return":
front.resolve({
value: value,
done: true
});
break;
case "throw":
front.reject(value);
break;
default:
front.resolve({
value: value,
done: false
});
break;
}
front = front.next;
if (front) {
resume(front.key, front.arg);
} else {
back = null;
}
}
this._invoke = send;
if (typeof gen.return !== "function") {
this.return = undefined;
}
}
if (typeof Symbol === "function" && Symbol.asyncIterator) {
AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
return this;
};
}
AsyncGenerator.prototype.next = function (arg) {
return this._invoke("next", arg);
};
AsyncGenerator.prototype.throw = function (arg) {
return this._invoke("throw", arg);
};
AsyncGenerator.prototype.return = function (arg) {
return this._invoke("return", arg);
};
return {
wrap: function (fn) {
return function () {
return new AsyncGenerator(fn.apply(this, arguments));
};
},
await: function (value) {
return new AwaitValue(value);
}
};
}();
var classCallCheck = function (instance, Constructor) {

@@ -212,2 +101,3 @@ if (!(instance instanceof Constructor)) {

var makeDir = require("make-dir");
var archiver = require("archiver");

@@ -505,2 +395,53 @@ var FileManagerPlugin = function () {

case "archive":
var _loop5 = function _loop5(key) {
var command = {
source: _this3.replaceHash(fileOptions[key].source),
destination: fileOptions[key].destination
};
if (!command.source || !command.destination) {
if (_this3.options.verbose) {
console.log(" - FileManagerPlugin: Warning - archive parameter has to be formated as follows: { source: <string>, destination: <string> }");
}
return {
v: void 0
};
}
commandOrder.push(function () {
return new Promise(function (resolve, reject) {
var fileRegex = /(\*|\{+|\}+)/g;
var matches = fileRegex.exec(command.source);
var isGlob = matches !== null ? true : false;
fs.lstat(command.source, function (sErr, sStats) {
var output = fs.createWriteStream(command.destination);
var archive = archiver("zip", {
zlib: { level: 9 }
});
archive.on("error", function (err) {
reject(err);
});
archive.pipe(output);
if (isGlob) archive.glob(command.source);else if (sStats.isFile()) archive.file(command.source, { name: path.basename(command.source) });else if (sStats.isDirectory()) archive.directory(command.source, false);
archive.finalize().then(resolve());
});
});
});
};
for (var key in fileOptions) {
var _ret5 = _loop5(key);
if ((typeof _ret5 === "undefined" ? "undefined" : _typeof(_ret5)) === "object") return _ret5.v;
}
break;
default:

@@ -507,0 +448,0 @@ break;

{
"name": "filemanager-webpack-plugin",
"version": "1.0.21",
"description": "This Webpack plugin allows you to copy, move, delete files and directories before and after builds",
"version": "1.0.22",
"description": "This Webpack plugin allows you to copy, archive (.zip), move, delete files and directories before and after builds",
"main": "lib/index.js",

@@ -30,3 +30,3 @@ "files": [

"devDependencies": {
"ava": "^0.24.0",
"ava": "^0.25.0",
"babel-cli": "^6.26.0",

@@ -39,11 +39,12 @@ "babel-core": "^6.26.0",

"delay": "^2.0.0",
"eslint": "^4.5.0",
"prettier": "^1.9.2",
"rollup": "^0.49.1",
"eslint": "^4.16.0",
"prettier": "^1.10.2",
"rollup": "^0.55.1",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-node-resolve": "^3.0.0",
"webpack": "^3.5.5",
"webpack-dev-server": "^2.7.1"
"webpack": "^3.10.0",
"webpack-dev-server": "^2.11.1"
},
"dependencies": {
"archiver": "^2.1.1",
"cpx": "^1.5.0",

@@ -53,4 +54,4 @@ "fs-extra": "^5.0.0",

"mv": "^2.1.1",
"rimraf": "^2.6.1"
"rimraf": "^2.6.2"
}
}

@@ -12,3 +12,3 @@

This Webpack plugin allows you to copy, move, delete files and directories before and after builds
This Webpack plugin allows you to copy, archive (.zip), move, delete files and directories before and after builds

@@ -52,2 +52,7 @@

'/another/directory/'
],
archive: [
{ source: '/path/from', destination: '/path/to.zip' },
{ source: '/path/**/*.js', destination: '/path/to.zip' },
{ source: '/path/fromfile.txt', destination: '/path/to.zip' },
]

@@ -111,1 +116,2 @@ }

|**`mkdir`**|Create a directory path. Think mkdir -p |mkdir: [ <br />'/path/to/directory/', '/another/path/' <br/> ]
|**`archive`**|Archive (.zip) individual files or entire directories |archive: [<br />{ source: 'dist/bundle.js', destination: '/home/web/archive.zip'<br /> }<br />]
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc