You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the same vein as copy/symlink check mtimes before doing their operation, it would be nice if this plugin also had a mechanism to not do work when it isn't needed.
One thought I have is that if the following conditions are all true, skip writing: (with a debug log indicating that)
file.stat exists (null stats probably mean the file completely exists in memory)
the file located at file.path already exists
file.stat.mtime < stat(file.path).mtime (ie: input file has not been modified since last output file modification)
My hope is that these conditions are so specific that they would not be met accidentally. (the hope is to avoid false positives that would cause someone's build to not go as expected)
In cases where a sub-tree of files is being combined into a single output file, (eg: js and css) my thought would be that during their "roll up", (aka: postdependencies they would bubble the latest mtime up to the top. Therefore, the mtime for the output file would be the latest mtime for the entire sub-tree.
As for any additional files being added to the tree, (eg: source map files) they could share file.stats with their parent file, which other plugins would need to know about to benefit from this behavior.
This behavior should hide behind a flag for now, but probably made the default in v2 if it turns out to be useful.
Copied from original issue: makojs/write#21
The text was updated successfully, but these errors were encountered:
From @dominicbarnes on October 8, 2016 20:48
In the same vein as copy/symlink check mtimes before doing their operation, it would be nice if this plugin also had a mechanism to not do work when it isn't needed.
One thought I have is that if the following conditions are all true, skip writing: (with a debug log indicating that)
file.stat
exists (null stats probably mean the file completely exists in memory)file.path
already existsfile.stat.mtime < stat(file.path).mtime
(ie: input file has not been modified since last output file modification)My hope is that these conditions are so specific that they would not be met accidentally. (the hope is to avoid false positives that would cause someone's build to not go as expected)
In cases where a sub-tree of files is being combined into a single output file, (eg: js and css) my thought would be that during their "roll up", (aka:
postdependencies
they would bubble the latestmtime
up to the top. Therefore, themtime
for the output file would be the latestmtime
for the entire sub-tree.As for any additional files being added to the tree, (eg: source map files) they could share
file.stats
with their parent file, which other plugins would need to know about to benefit from this behavior.This behavior should hide behind a flag for now, but probably made the default in v2 if it turns out to be useful.
Copied from original issue: makojs/write#21
The text was updated successfully, but these errors were encountered: