gpt4 book ai didi

javascript - 使用 grunt-cdnify 时出现错误

转载 作者:行者123 更新时间:2023-12-03 10:52:08 33 4
gpt4 key购买 nike

我正在使用grunt-cdnify对于 CDN 我的网络 Assets 。我正在使用 REMADME.md 文件中提到的以下配置。

 cdnify: {
makeItAws: {
options: {
base: 'http://my.cdn.com/'
},
files: [{
expand: true,
cwd: '<%= app.dist %>',
src: '**/*.{css,html,js}',
dest: '<%= app.dist %>'
}]
}
},

我的 grunt 任务注册

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 的问题,而是因为您的配置变量“app”未定义。确保在 grunt 文件的配置部分正确定义应用程序,例如:

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

app: {
dist: 'dist'
},
etc...

关于javascript - 使用 grunt-cdnify 时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28392647/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com