UNPKG

makestatic-manifest

Version:

Generates a JSON manifest of the output files

125 lines (86 loc) 3.04 kB
# Manifest > Generate manifest of output files --- - [Install](#install) - [API](#api) - [Manifest](#manifest) - [See Also](#see-also) - [Manifest](#manifest-1) - [Options](#options) - [.sources](#sources) - [.after](#after) - [License](#license) --- ## Install ``` yarn add makestatic-manifest ``` ## API ### Manifest Generates a JSON manifest of the output files that is written to `manifest.json` in the output directory. #### See Also * [Core Standard](https://makestatic.ws/docs/api/core-standard/ "Core Standard") #### Manifest ```javascript new Manifest(context[, options]) ``` Creates a Manifest plugin. The structure of the generated document is: ```json { "algorithm": "sha512", "files": {} } ``` Each key in the `files` map is the path of the file relative to the output directory. Each file entry contains the fields: + `source` the original source file. + `hash` object containing checksums. + `size` the size of the file in bytes. Transient files are not included in the manifest. * `context` Object the processing context. * `options` Object the plugin options. ##### Options * `algorithm` String=sha512 checksum generation algorithm. #### .sources ```javascript Manifest.prototype.sources(file, context) ``` Adds files to the manifest data. If the `manifest` context option is not set this function call is a noop. * `file` Object the current file. * `context` Object the processing context. #### .after ```javascript Manifest.prototype.after(context) ``` Adds the manifest file to the pipeline. If the `manifest` context option is not set this function call is a noop. * `context` Object the processing context. ## License MIT --- Created by [mkdoc](https://github.com/mkdoc/mkdoc) on March 13, 2017 [docs]: https://makestatic.ws/docs/ "Documentation" [standalone manual]: https://github.com/makestatic/website/blob/master/MANUAL.md "Standalone Manual" [yarn]: https://yarnpkg.com "Yarn" [webpack]: https://webpack.js.org "Webpack" [babel]: https://babeljs.io "Babel" [postcss]: http://postcss.org "Postcss" [sugarss]: https://github.com/postcss/sugarss "Sugarss" [reshape]: https://github.com/reshape/reshape "Reshape Source Code" [reshapeml]: https://reshape.ml "Reshape" [clean-css]: https://github.com/jakubpawlowicz/clean-css "Clean CSS" [html-minifier]: https://github.com/kangax/html-minifier "Html Minifier" [uglify-js]: https://github.com/mishoo/UglifyJS2 "Uglify JS" [imagemin]: https://github.com/imagemin/imagemin "Imagemin" [mkdoc]: https://github.com/mkdoc/mkdoc "Mkdoc" [browsersync]: https://www.browsersync.io "Browsersync" [yeoman]: http://yeoman.io "Yeoman" [spike]: https://www.spike.cf "Spike" [validator]: https://github.com/validator/validator "HTML Validator" [github pages]: https://pages.github.com "Github Pages" [amazon s3]: https://aws.amazon.com/s3/ "Amazon S3" [google sitemaps]: https://support.google.com/webmasters/answer/183668?hl=en&ref_topic=4581190 "Google Sitemaps" [sitemaps]: https://www.sitemaps.org/ "Sitemaps"