gobble-html-minifier

0.1.1 • Public • Published

gobble-html-minifer

npm Build Status Coverage Status Dependencies

Simple wrapper to use html-minifier with gobble.

Installation

First, you need to have gobble installed - see the gobble readme for details. Then,

npm install --save-dev gobble-html-minifier

Usage

gobblefile.js

var gobble = require('gobble');
 
module.exports = gobble('src').transform('html-minifier', options);

The options argument, if specified, is passed to html-minifier. Please refer to the original documentation.

There is one extra option preset in this plugin to try to make developer's life easier.

preset

Type: string|undefined

The preset option accepts one of three string value: "minimal", "safe", and "all". They correspond to the presets found on html-minifier's Github page. If left undefined or when set to unsupported value, it doesn't affect other options at all. Otherwise, the preset options act as the default and other options passed in overrides the preset.

Usage

// to use the "minimal" preset alone
gobble('src').transform('html-minifier', { preset: 'minimal' });
 
// use the "minimal" preset but turn off "removeComments"
gobble('src').transform('html-minifier', {
  preset: 'minimal',
  removeComments: false,
});

Dependencies (2)

Dev Dependencies (19)

Package Sidebar

Install

npm i gobble-html-minifier

Weekly Downloads

4

Version

0.1.1

License

MIT

Last publish

Collaborators

  • justin-lau