ricardo
ricardo

Reputation: 125

Yeoman + Grunticon: Gruntfile.js problems

So i'm trying to use grunticon into my yo webapp (yeoman) but it says it cannot read any files.

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/'
               }
         }
   },

Full Gruntfile.js: https://gist.github.com/ricardobanegas/6c8c4ad3ac57f49728d7

Patch: 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.

So the question is really, why is Gruntfile.js not finding my images inside app/images/svg-src/?

References:

Grunticon

Yeoman+Grunticon install guidelines

Any ideas?

Upvotes: 1

Views: 427

Answers (2)

ricardo
ricardo

Reputation: 125

This was changed since version 1.0.0: https://github.com/filamentgroup/grunticon#whats-changed-in-this-major-version

Looks like I was following an old tutorial. Using files: [] instead of options: {} solved the problem:

grunticon: {
    myIcons: {
        files: [{
            expand: true,
            cwd: '<%= config.app %>/images/svg-src/',
            src: '{,*/}*.svg',
            dest: '<%= config.dist %>/images/svg-dist/'
         }],

         options: {

         }
        }
    },

Upvotes: 1

jgillich
jgillich

Reputation: 76369

src must point to actual files, not just a folder.

src: '<%= config.app %>/images/svg-src/*.svg'

Upvotes: 0

Related Questions