github pugjs/pug pug-filters@4.0.0

latest releases: pug@3.0.2, pug-lexer@5.0.1, pug-runtime@3.0.1...
3 years ago

Breaking Changes

  • The minify option 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 expect a Buffer instead of a string (#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 + '"/>';
        }
      }
    };

    You can then use the filter like:

    // foo.pug
    include:png my-small-image.png

Don't miss a new pug release

NewReleases is sending notifications on new releases.