Open voltidev opened 10 years ago
I'm a bit confused. i believe that newer looks at src files and compares them to that last build time.
can you restate the problem you're facing?
I agree with @mattkime , I cant see an issue here, and believe this is the expected behaviour
+1 .... Trying to operate on SCSS
files, but it's only considering the bundle files, and not any partials because they would NEVER exist in the destination as per how SASS compilers work, they ignore partials (e.x.: files starting with an underscore).
It seems that a default of current logic is fine, but could be overridden by a forceSrcEval
boolean in options. This would then utilize the source file for comparing against the destination file.
Example:
[SRC]
assets/
css/
main.bundle.scss
_partial_included_in_main.scss
[DEST]
dist/
/assets
/css
/main.bundle.css
As you can see, on initial compile of starting the grunt task, the main bundle is compiled as expected, and all partials are left in the source (and embedded within the main bundle). As stated above, since the partials never exist in the destination folder there's no way to validly compare.
The only caveat on this is that processing new files will iterate over all watched files and evaluated through override
or the filters.
I have encountered the same problem. I am using a grunt task to convert an SVG into various different-sized PNGs. I would like newer
to only look at the last-modified date of the SVG file, which is the 'src' file in my grunt task. The task I am using specifies a 'dest' directory, where the PNGs are output, but newer
thinks that the destination file is going to be an SVG file with the same name as the 'src' file, just in the 'dest' directory. However, the output of the task is actually lots of different PNG files in the 'dest' directory, none of which have the same name as the 'src' file.
There are two situations I can think of that are affected, and imagine they could be quite common:
newer
will always re-run the task to which it is attached.newer
will always re-run the task to which it is attached.Essentially the underlying problem is:
newer
should only check the modification date of the 'src' file(s).Therefore: if we had an option to force newer
to look at the last-modified date of the 'src' file only, ignoring any 'dest' file/files, then newer
could be used with any grunt task that generates temporary files, or tasks that generate many output files for one 'src' file.
P.S. Thanks for this plugin; when this issue is resolved it's going to save me (and others I hope) a lot of time :-).
Even if a task specifies dest files, there should be a way to force newer to work in "src only mode".
What if you clean the dest directory within the building process. So newer will have no chance to ignore old files.
For example: