tschaub / grunt-newer

Configure Grunt tasks to run with newer files only.
https://npmjs.org/package/grunt-newer
MIT License
945 stars 53 forks source link

Work with grunt-webfont #45

Open artpolikarpov opened 10 years ago

artpolikarpov commented 10 years ago

Test repository: https://github.com/artpolikarpov/newer-webfont-test

Just can’t prefix grunt-webfont with grunt-newer.

When I simply run grunt I get this:

screen shot 2014-05-19 at 15 18 09

But webfont.icons.src is in Gruntfile.js.

When I run unprefixed grunt webfont and then grunt again everything looks fine:

screen shot 2014-05-19 at 15 24 51

But now it doesn’t react to the changes in src/icons/ and always says that “no newer files to process”:

screen shot 2014-05-19 at 15 37 30

What is wrong?


/cc @sapegin — creator of grunt-webfont

sapegin commented 10 years ago

Something strange happens to this.data. When I run grunt webfont webfont receives normal options object:

{ src: 'src/icons/*.svg',
  dest: 'out/css/fonts',
  destCss: 'out/css',
  options: { htmlDemo: false } }

But when I run grunt newer:webfont it receives very strange object:

{ destCss: 'out/css',
  options: { htmlDemo: false },
  files:
   [ { src: [Object],
       dest: 'out/css/fonts',
       destCss: 'out/css',
       orig: [Object] } ] }
mpalpha commented 9 years ago

My "proxy task" workaround until this is resolved.

Add some grunt-newer compatible proxy task configuration options inside grunt.initConfig

// Add src and dest attributes to your "icons" proxy task for grunt-newer.
icons: {
    build: {
        // used src from the svgmin config and dest from webfont config.
        src: 'assets/icons/*/min/*',
        dest: 'assets/fonts/'
    }
}

Register the proxy task.

// add wrapper task to fix grunt-newer/webfont compatibility issue
grunt.registerTask('icons', 'build glyphicons.', function() {
    grunt.task.run('svgmin','webfont');
});

//use "'newer:icons'" to build the glyphicons using grunt-newer

ArmorDarks commented 9 years ago

Hi

Any chances to see native fix of that issue?

jsmirnov commented 9 years ago

/ping