pug@3.0.0
Breaking Changes
-
readplugins must now returnBufferif you want to support filters that userenderBuffer(#3213)If you don't wish to support this advanced use case, you can continue returning
string. If you did not provide areadplugin, you do not need to do anything. -
The
minifyoption on filters now requires you to install the relevant jstransformer (#3084)Currently we support:
- jstransformer-uglify-js for JavaScript
- jstransformer-clean-css for CSS
-
Drop support for node 6 and 8 (#3243)
New Features
-
Support filters that apply to Buffers (#3213)
e.g.
// options.js exports.filters = { png: { // instead of a function, specify an object with a "renderBuffer" property // whose value is a function that takes a Buffer instead of a string renderBuffer: function(buffer, options) { var data = Buffer.from(buffer).toString('base64'); return '<img src="data:image/png;base64, ' + data + '"/>'; } } };