我们在 index.html 中定义了 2 个块 - 一个用于 3rd 方库,一个用于我们的应用程序文件。由于 3rd 方库已经被缩小,我们只想连接它们,而不是 uglify。我该怎么做useminPrepare
?
<!-- build:js js/lib.js -->
<script src="lib/angular/angular.min.js"></script>
<script src="lib/angular-cookies/angular-cookies.min.js"></script>
<script src="lib/angular-route/angular-route.min.js"></script>
<!-- endbuild -->
<!-- build:js js/app.js -->
<script src="js/app.js"></script>
<script src="js/controllers/LanguageCtrl.js"></script>
<!-- endbuild -->
gruntfile.js:
useminPrepare: {
html: '<%= yeoman.app %>/index.html',
options: {
dest: '<%= yeoman.dist %>',
flow: {
html: {
steps: {
// TODO for libs.js block I don't want uglify!
js: ['concat', 'uglifyjs'],
css: ['cssmin']
},
post: {}
}
}
}
}