所以我尝试在我的 yo webapp
(yeoman) 中使用 grunticon ,但它说它无法读取任何文件。
Gruntfile.js:
svgmin: {
dist: {
files: [{
expand: true,
cwd: '<%= config.app %>/images/svg-src/',
src: '{,*/}*.svg',
dest: '<%= config.dist %>/images/svg-src/'
}]
}
},
grunticon: {
myIcons: {
options: {
src: '<%= config.app %>/images/svg-src/',
dest: '<%= config.app %>/images/svg-dist/'
}
}
},
完整的 Gruntfile.js:https://gist.github.com/ricardobanegas/6c8c4ad3ac57f49728d7
补丁:https://gist.github.com/ricardobanegas/7f2933bfb8e58d7ef30c
Unix:
$ grunt grunticon:myIcons
Running "grunticon:myIcons" (grunticon) task
Look, it's a grunticon!
Grunticon has no files to read!
Done, without errors.
所以问题是,为什么 Gruntfile.js 在 app/images/svg-src/
中找不到我的图像?
引用文献:
Yeoman+Grunticon install guidelines
有什么想法吗?
最佳答案
自版本 1.0.0 以来已更改:https://github.com/filamentgroup/grunticon#whats-changed-in-this-major-version
看起来我正在遵循旧教程。使用 files: []
而不是 options: {}
解决了问题:
grunticon: {
myIcons: {
files: [{
expand: true,
cwd: '<%= config.app %>/images/svg-src/',
src: '{,*/}*.svg',
dest: '<%= config.dist %>/images/svg-dist/'
}],
options: {
}
}
},
关于javascript - Yeoman + Grunticon : Gruntfile. js 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23806054/