Create zip archive of build files.

Creates a zip archive of the output files so you can archive builds and rollback to an earlier build if needed.

Integrates with the build-version plugin so your archives are automatically versioned.

new ArchiveZip(context, options)

Create an ArchiveZip plugin.

Configure this plugin for the emit phase, if you only want this plugin to execute when a deploy is performed add it to the audit phase.

By default zip files are written to the archive directory, you can change this path using the output option.

If the desination file exists it is overwritten. The output directory must already exist.

If versions information is available (when the build-version plugin has been configured) the file name will automatically include the version using the key specified with the version option.

When the prefix option is not given it defaults to the basename of the output directory.


Prepare the zip archive.

ArchiveZip.prototype.sources(file, context, options)

Add each file to the archive.

Files marked as transient are ignored.

ArchiveZip.prototype.after(context, options)

Write the zip archive to disc.

Assigns the output archive path to