Closed YannickGagnon closed 7 years ago
You could do your version calculation logic outside the configuration of the plugin and pass the already calculated version as data. I actually would encourage this, otherwise the performance of calling the function every time a file is processed could be affected seriously if misused.
Thanks for your feedback :)
Thanks and sorry about the delayed answer. I agree this could be misused, in my case, it's only called when I package a distribution version ;)
But I agree with you, modifying this plugin for my use case might cause more problems for others.
Don't bother ;)
Would be pretty helpful to be able to assign function to option > data
One example could be:
version: function() { var version = 1; if(!grunt.file.exists('VERSION')) { version = grunt.file.read('VERSION'); } }
I know one work-around could be to have a task write/overwrite this property from outside using:
grunt.registerTask('presetVersion', function() {
});
Thanks,