あなたの質問は usemin に関連しています。こちらのドキュメントを参照してください: https://github.com/yeoman/grunt-usemin
index.html のコメントを次のように置き換えます。
<!-- build:js(./) /dashboard/scripts/vendor.js -->
つまり:
<!-- build:PATH_WHERE_TO_FIND_FILES DESTINATION_PATH -->
ngmin を ngAnnotate に置き換えるには:
Gruntfile を変更します。
交換:
// ngmin tries to make the code safe for minification automatically by
// using the Angular long form for dependency injection. It doesn't work on
// things like resolve or inject so those have to be done manually.
ngmin: {
dist: {
files: [{
expand: true,
cwd: '.tmp/concat/scripts',
src: '*.js',
dest: '.tmp/concat/scripts'
}]
}
},
に
ngAnnotate: {
options: {
singleQuotes: true
},
dist: {
files: [{
expand: true,
cwd: '.tmp/concat/scripts',
src: '*.js',
dest: '.tmp/concat/scripts'
}]
}
},
そして置き換えます:
grunt.registerTask('build', [
'clean:dist',
'wiredep',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'ngmin',
'copy:dist',
'cdnify',
'cssmin',
'uglify',
'filerev',
'usemin',
'htmlmin'
]);
に:
grunt.registerTask('build', [
'clean:dist',
'wiredep',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'ngAnnotate',
'copy:dist',
'cdnify',
'cssmin',
'uglify',
'filerev',
'usemin',
'htmlmin'
]);
次の 2 つのコマンドを実行して、package.json を変更します。 1. npm uninstall grunt-ngmin --save 2. npm install grunt-ng-annotate --save