I found an HTML compression gulp plugin that I want to use. I encountered a coding problem.
This is written in someone else's plugin:
gulp.task ('indexHtml', function () {
return gulp.src ('index.html')
.pipe (cheerio (function ($) {
$ ('script'). remove ();
$ ('link'). remove ();
$ ('body'). append ('<script src = "skin / zhuce / MergeMin / app.full.min.js"> </ script>');
$ ('head'). append ('<link rel = "stylesheet" href = "skin / zhuce / MergeMin / app.full.min.css">');
})))
.pipe (gulp.dest ('test /'));
});
But the output is unified Unicode. Cause some characters cannot be read only in the browser to explain.
I searched and found a solution that others pointed out:
Use cheerio.load (html, {decodeEntities: false});
Incoming parameters
But I do not know how to do it in Node.js.
I'm facing this nesting in the above code:
.pipe (cheerio (function ($) {
I do not know how to change: cheerio.load (html, {decodeEntities: false});
.