0
我想用grunt併發來並行地縮小我的JavaScript文件。我也使用usemin和ngmin。uglify與咕嚕併發不工作
當我使用醜化不咕嚕,同時我得到這個日誌輸出預期的結果:
Running "uglify:dist" (uglify) task
Running "uglify:dist/scripts/jquery_and_angular.js" (uglify) task
File dist/scripts/jquery_and_angular.js created.
Running "uglify:dist/scripts/external-non-angular-libraries.js" (uglify) task
File dist/scripts/external-non-angular-libraries.js created.
Running "uglify:dist/scripts/modules.js" (uglify) task
File dist/scripts/modules.js created.
Running "uglify:dist/scripts/scripts.js" (uglify) task
File dist/scripts/scripts.js created.
但是當我嘗試使用咕嚕,同時通過這種結構來執行此任務:
concurrent: {
lessAndMinify: [
'ngmin',
'less'
],
uglify: [
'uglify:dist/scripts/jquery_and_angular.js',
'uglify:dist/scripts/external-non-angular-libraries.js',
'uglify:dist/scripts/modules.js',
'uglify:dist/scripts/scripts.js',
'uglify:dist/scripts/templates.js'
]
},
我得到這個任務沒有配置信息:
Running "concurrent:uglify" (concurrent) task
Warning: Running "uglify:dist/scripts/jquery_and_angular.js" (uglify) task
Verifying property uglify.dist/scripts/jquery_and_angular\.js exists in config...ERROR
>> Unable to process task.
Warning: Required config property "uglify.dist/scripts/jquery_and_angular\.js" missing. Use --force to continue.
Aborted due to warnings. Used --force, continuing.
Running "uglify:dist/scripts/jquery_and_angular.js" (uglify) task
Verifying property uglify.dist/scripts/jquery_and_angular\.js exists in config...ERROR
>> Unable to process task.
Warning: Required config property "uglify.dist/scripts/jquery_and_angular\.js" missing. Use --force to continue.
Aborted due to warnings.
Warning: Running "uglify:dist/scripts/modules.js" (uglify) task
Verifying property uglify.dist/scripts/modules\.js exists in config...ERROR
>> Unable to process task.
Warning: Required config property "uglify.dist/scripts/modules\.js" missing. Use --force to continue.
Aborted due to warnings. Used --force, continuing.
Running "uglify:dist/scripts/modules.js" (uglify) task
Verifying property uglify.dist/scripts/modules\.js exists in config...ERROR
>> Unable to process task.
Warning: Required config property "uglify.dist/scripts/modules\.js" missing. Use --force to continue.
我生成任務配置IST這樣的:
grunt.registerTask('build', [
'clean:dist',
'ngtemplates',
'copy:indexHtml',
'replace',
'useminPrepare',
'concat',
'copy:dist',
'copy:generated',
'concurrent:lessAndMinify', // ngmin and less
// 'concurrent:uglify',
'uglify',
'rev',
'usemin'
]);
的問題是,如何才能讓使用咕嚕,同時與醜化和usemin/ngmin的?