使用Grunt Uglify在JavaScript中是否可以删除特殊注释之间的代码?
例如,像这样的js代码:
源代码:
var that = this;
var x=y;
//REMOVE-BEGIN
that.someCodeToBeRemoved();
that.someMoreCodeToBeRemoved();
//REMOVE-END
that.someFunctionCall();
需要移除的内容:
//REMOVE-BEGIN
that.someCodeToBeRemoved();
that.someMoreCodeToBeRemoved();
//REMOVE-END
SourceMaps
可以帮助 https://github.com/gruntjs/grunt-contrib-uglify#sourcemap - Pietro