DefinitelyTyped/types/zip-webpack-plugin/zip-webpack-plugin-tests.ts
Blaise Kal f3c6f4aec3 New typings for zip-webpack-plugin (#27032)
* Typings for zip-webpack-plugin

* Switch to ReadonlyArray for include and exclude options

* Fix linting errors

* Fix TypeScript version
2018-07-03 15:11:41 -07:00

29 lines
673 B
TypeScript

import * as ZipPlugin from "zip-webpack-plugin";
new ZipPlugin();
const options: ZipPlugin.Options = {
include: "include.string",
exclude: "exclude.string",
};
new ZipPlugin(options);
new ZipPlugin({
path: "path",
filename: "filename",
extension: "ext",
pathPrefix: "prefix",
pathMapper: (assetPath) => `pathMapper/${assetPath}`,
include: ["include.string", /include\.regexp/],
exclude: ["exclude.string", /exclude\.regexp/],
fileOptions: {
mtime: new Date(),
mode: parseInt("0100664", 8),
compress: false,
forceZip64Format: true,
},
zipOptions: {
forceZip64Format: true,
}
});