0.0.1 • Published 5 years ago

@snacking/html-minify v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

@snacking/html-minify 使用指南

说明

html压缩...

安装

npm install @snacking/html-minify --save

方法调用

const { uglify } = require("@snacking/html-minify");
console.log( uglify(`
    <div>
        hello
    </div>
`) );

在gulp中使用

const { src, dest } = require("gulp");
const { forGulp: uglify } = require("@snacking/html-minify");
src("./*.html").pipe(uglify()).pipe(dest("./dist"));

可以设置options,具体选项参见https://www.npmjs.com/package/html-minifier-terser...

src("./*.json").pipe(uglify({
    collapseWhitespace: false
})).pipe(dest("./dist"));