压缩html时出现 内部js代码压缩不成功的问题

const minJs = require('uglify-es');

pipe(htmlmin({
            removeComments: true,
            collapseWhitespace: true,
            minifyCSS: true,
            minifyJS: function(text) {
                return minJs.minify(text, {
                    mangle: false
                }).code;
            }
        }))

  

posted @ 2021-11-12 16:07  xiaorain124  阅读(142)  评论(0)    收藏  举报