-
Notifications
You must be signed in to change notification settings - Fork 382
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
Not updating modified timestamp of output when working with @import #706
Comments
It looks like Gulp 4 deliberately does not set mtime anymore, and so the output file now inherits the input file's timestamps (probably purely by historical accident). It's probably on this library to update the mtime. |
Such a feature would belong in a gulp mtime plugin. Gulp Sass is blind to
fs watching. It only cares about compile sass to css
…On Thu., 13 Sep. 2018, 4:29 am Ken Newman, ***@***.***> wrote:
It looks like Gulp 4 deliberately does not set mtime anymore, and so the
output file now inherits the input file's timestamps (probably purely by
historical accident).
It's probably on this library to update the mtime.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#706 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjZWDkDGitQ7QSfUdsOW65E0Docc1drks5uaVKEgaJpZM4WM6B1>
.
|
I hope you reconsider. This plugin is responsible for the compiled css file, and that file that is compiled from it is reporting the wrong modified time. It's a bug. https://github.com/dlmanning/gulp-sass/blob/master/index.js#L99 EDIT: |
In the meantime, if anyone needs the output file to have an updated modified/accessed time, you can pipe this before the gulp.dest pipe (requires you add through2) .pipe( through2.obj( function( file, enc, cb ) {
var date = new Date();
file.stat.atime = date;
file.stat.mtime = date;
cb( null, file );
}) )
.pipe( gulp.dest( './' ) ) |
Fixed in v4.1.0 |
gulp-sass does not seem to update the modified date of the generated .css file,
instead it uses the same date as the input .scss file.
This leads to problems when using gulp-sass together with rails/sprockets. If I update .scss files that are imported into a global.scss, the created css file will still use the same modified timestamp as the global.scss and sprockets will not load the new file.
In order to fix this, I had to manually update the modified time after gulp-sass:
Tested with versions
2.0.4
and4.0.1
.Gulp
4.0.0
I'm not sure if this is a problem of gulp-sass or gulp itself.
The text was updated successfully, but these errors were encountered: