我正在使用grunt-cdnify作爲CDN我的網絡資產。在REMADME.md文件中,我正在使用下面的配置。使用grunt-cdnify時出現錯誤
cdnify: {
makeItAws: {
options: {
base: 'http://my.cdn.com/'
},
files: [{
expand: true,
cwd: '<%= app.dist %>',
src: '**/*.{css,html,js}',
dest: '<%= app.dist %>'
}]
}
},
我咕嚕任務寄存器
grunt.registerTask('build', [
'clean:dist',
'wiredep',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'ngAnnotate',
'copy:dist',
'cdnify',
'cssmin',
'uglify',
'filerev',
'usemin',
'htmlmin',
'cdnify'
]);
我收到此錯誤以下
Anjums-MacBook-Pro:project anjum$ grunt cdnify
Running "cdnify:makeItAws" (cdnify) task
Warning: An error occurred while processing a template
(Cannot read property 'dist' of undefined). Use --force to continue.
Aborted due to warnings.
Execution Time (2015-02-08 08:42:51 UTC)
loading tasks 3ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 33%
cdnify:makeItAws 5ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 56%
Total 9ms
任何想法,我錯了?請指導我。謝謝
的cdnify任務是重寫你的HTML和CSS發現靜態資源的URL。一旦請檢查您應用中的所有網址(CDN),看看它們是否指向正確的地址? – Rajeshwar 2015-02-08 10:44:26
'grunt.registerTask('build',...)'註冊一個名爲'build'的任務,該任務應該使用'grunt build'運行。你註冊了一個名爲grunt.registerTask('cdnify',...)的任務嗎? – 2015-05-26 19:05:02