我最近开始使用Yeoman中的GruntJS,我很喜欢JavaScript代码压缩的想法,但在开发过程中它会带来一些困难。我尝试在Gruntfile中以不同的组合禁用uglify、usemin等,但似乎每个东西都依赖于另一个东西并且破坏了整个流程。有没有简单的方法来禁用代码压缩?我正在使用到目前为止Yeoman提供的最新版本的Grunt,我发现旧的解决方案与Yeoman所使用的Gruntfile设置不同。
以下是我的Gruntfile:
以下是我的Gruntfile:
// Reads HTML for usemin blocks to enable smart builds that automatically
// concat, minify and revision files. Creates configurations in memory so
// additional tasks can operate on them
useminPrepare: {
options: {
dest: '<%= config.dist %>'
},
html: '<%= config.app %>/index.html'
},
//默认情况下,您的“index.html”的<!-- Usemin block -->将负责缩小。如果您不希望使用Usemin块,则已预先配置这些选项。// uglify: {...
请参见添加的Gruntfile。 - frazras