有没有办法在不破坏代码的情况下实现这一点?我试过 mangleProperties 但我的代码确实不起作用,即使在使用正则表达式和“控制器作为”功能(https://daveceddia.com/convert-scope-to-controlleras/)之后也是如此。
gulp.task('useref', ['ng_annotate2'], function (done) {
gulp.src('./www/index.html')
.pipe(useref())
.pipe(gulpif('*.js', uglify({
mangleProperties: {
regex: /something$scope/
}
})))
.pipe(gulpif('*.css', minifyCss()))
.pipe(gulp.dest('./www/dist'))
.on('end', done);
});