扫码关注官方订阅号
当合并js的时候就报错,请问可以解决吗,谢谢!
欢迎选择我的课程,让我们一起见证您的进步~~
额,我用了gulp-htmlmin这个插件,只要在useref前面删除gulp-html插件使用就行了。
gulp.task('useref', function() { return gulp.src('app/*.html') // .pipe($.htmlmin({removeComments: true})) //这个不能放在useref之前 .pipe($.useref()) .pipe($.if('*.js', $.uglify())) .pipe($.if('*.css', $.cleanCss({ compatibility: 'ie9' }))) .pipe($.if('*.css', $.autoprefixer())) .pipe(gulp.dest('dist')); });
打分号了吗;JS在压缩时里面的参数会变成一个字母;这个也需要注意
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
额,我用了gulp-htmlmin这个插件,只要在useref前面删除gulp-html插件使用就行了。
打分号了吗;JS在压缩时里面的参数会变成一个字母;这个也需要注意