-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renaming a file causes newer to update all files next time around #68
Comments
Or, third option, I am doing something wrong :) |
The problem is that Grunt resolves your src:dest mapping as a many:1 mapping (as it should). It sees that there are many src files (your It used to be that this plugin provided two tasks: I'm not sure I fully understand why you are copying many source files to one destination file (without necessarily knowing which wins), but I think you could use module.exports = function(grunt) {
grunt.initConfig({
copy: {
componentDev: {
files: [{
expand: true,
cwd: 'devfiles/components',
src: '**/*.css',
dest: 'buildfiles',
flatten: true
}]
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['copy']);
}; Sorry I don't have a better solution. |
Thank you for your reply. I appreciate it, and I certainly appreciate the work of open-source contributors like yourself. Or, write my own grunt plugin. Which I don't much fancy, but, needs must :) |
I think this is easier to explain with some code
My file system:
and the relevant bit of my Gruntfile
So, the idea is to watch the dev files directory, pull out whichever "style.css" changed, and copy it to the buildfiles directory. (the watch "files" is a bit vague because there is other stuff going on as well)
First time that it "watches", all the styles.css files get copies, which is fine, they just overwrite each other and the one from the alphabetically-last component wins.
This is ok.
The developer then starts with their work, and next time they change a style.css in any component, this one should overwrite the styles.css in buildfiles. (as it is the only one with a modification date larger than the last run date)
This is what I understand by
"Run Grunt tasks with only those source files modified since the last successful run."
The modification time should be compared to the last run time. However, renaming the watched file when copying it (or the deleting of old copied and watched files) screws everything up and on the next run, all the matching files are copied again, and I once again end up with the last-alpha-component.
This must mean that there is some comparison between the modification date of the source file and the creation date of the copied file. This has to be a bug. Or the description of grunt-newer is wrong.
The text was updated successfully, but these errors were encountered: