This package has been deprecated

Author message:

Moved to @hoast/hoast.

hoast-minify

1.2.1 • Public • Published

npm package @latest npm package @next

Travis-ci status CodeCov coverage

License agreement Open issues on GitHub

hoast-minify

Minify CSS, HTML, and JS files using clean-css, html-minifier, and terser respectively.

As the name suggest this is a hoast module.

Usage

Install hoast-minify using npm.

$ npm install --save hoast-minify

Parameters

  • css: Options for clean-css.
    • Type: Object
      • Default: {}
  • html: Options for html-minifier.
    • Type: Object
      • Default: { collapseWhitespace: true, removeComments: true }
  • js: Options for terser.
    • Type: Object
      • Default: {}
  • patternsCSS: Glob patterns to match file paths with that will be processed by clean-css.
    • Type: String or Array of strings
      • Default: [ '*.css' ]
  • patternsHTML: Glob patterns to match file paths with that will be processed by html-minifier.
    • Type: String or Array of strings
      • Default: [ '*.html' ]
  • patternsJS: Glob patterns to match file paths with that will be processed by terser.
    • Type: String or Array of strings
      • Default: [ '*.js', '*.mjs' ]
  • patternOptions: Options for the glob pattern matching. See planckmatch options for more details on the pattern options.
    • Type: Object
    • Default: {}
  • patternOptions.all: This options is added to patternOptions, and determines whether all patterns need to match instead of only one.
    • Type: Boolean
    • Default: false

The css and js options will also be given to the html-minifier to use for CSS and JS content within HTML files.

Examples

CLI

{
  "modules": {
    "read": {},
    "hoast-minify": {}
  }
}

Script

const Hoast = require(`hoast`);
const read = Hoast.read,
      minify = require(`hoast-minify`);
 
Hoast(__dirname)
  .use(read())
  .use(minify())
  .process();

Readme

Keywords

Package Sidebar

Install

npm i hoast-minify

Weekly Downloads

1

Version

1.2.1

License

ISC

Unpacked Size

10.4 kB

Total Files

6

Last publish

Collaborators

  • redkenrok