javascript - Yeoman + Grunticon : Gruntfile. js 问题

标签 javascript svg gruntjs yeoman yeoman-generator

所以我尝试在我的 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/ 中找不到我的图像?

引用文献:

Grunticon

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/

相关文章:

javascript - 如何结合其他属性在jqgrid中设置编辑表单位置和大小

javascript - 如何将 Angular 2 事件绑定(bind)到 svg 对象?

javascript - 使用 D3 附加到 SVG 的元素未出现

internet-explorer - Highcharts 将重复的 xmlns 属性添加到 IE 中的 SVG 元素

javascript - node.js - grunt 服务器未启动

java - Grunt,Livereload 与 maven 和 jetty 服务器

javascript - Font-awesome 无法与推送到 Heroku 的 yeoman 生成器一起使用

javascript - 在 javascript 中使用 string.replace() 来更改文本区域的内容

javascript - 如何在购物车中拖动新数据后从购物车中删除旧数据

javascript - 由一条线连接的 Css3 响应圈?