There is a problem with npm library for html minify. I downloaded and declared a library
import htmlmin from 'html-minifier';
but when i try to run a gulp task
export const html = () => {
return gulp.src("source/*.html")
.pipe(htmlmin({ collapseWhitespace: true }))
.pipe(gulp.dest("build"));
}
but a got an error
TypeError: htmlmin is not a function
I am pretty sure there is no syntax error but I dont know what is a problem.
I tried different liabraries and more old node.js but I still got same problem
2
Answers
it worked after I instaled special library for gulp gulp-htmlmin after a have seen usage for this one
Please take a look at library documentation.
There is a precise example of how to use the library with gulp: