grunt-newer
grunt-newer copied to clipboard
Work with grunt-webfont
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:
But webfont.icons.src
is in Gruntfile.js.
When I run unprefixed grunt webfont
and then grunt
again everything looks fine:
But now it doesn’t react to the changes in src/icons/ and always says that “no newer files to process”:
What is wrong?
/cc @sapegin — creator of grunt-webfont
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] } ] }
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
Hi
Any chances to see native fix of that issue?
/ping