thanpolas/grunt-closure-tools

Make file skipping optional

Closed this issue · 2 comments

Based on my reading of lines 183-203 in closureCompiler.js, it looks like there is a check before compilation to see if any of the source files have been modified since the last output file was generated.

This check may erroneously skip minification if a file exists at the dest file location with a newer mtime than each source file, since the existence of a newer file there does not necessarily mean the file was the result of a closure compilation. I'm not sure of an elegant way to be sure that the dest file is actually one recently generated by closure compiler, so I suggest making that an optional feature that is disabled by default and documenting its behavior.

This sounds reasonable, @izb any comments before i make it so?

izb commented

Sounds reasonable to make it an option. I'd say that if you have files newer than the source that do not naturally belong there, then you're asking for trouble in most build systems anyway. That said, the option would still be useful.