Closed generalov closed 2 years ago
I think this current behavior is correct, in that the source file is the template for a newly created css file that essentially overwrites the destination, not updates it.
That said, there's a workaround where you can build an inline plugin that could adjust the file.stat
however you like using through2
or similar:
.pipe( through2.obj( function( file, enc, cb ) {
// work out how to get 'some_path'
file.stat = fs.statSync( some_path );
cb( null, file );
}) )
.pipe( gulp.dest( './' ) )
gulp-sass 4.0.2
Actual: CSS file on the output inherits the whole file.stats object from SCSS file on the input. Expected: reuse file systems stat for a CSS file when the file exists.
Let's imaging the following file system layout:
main.scss with read only attribute includes a writable _include.scss. _include.scss file is changed. After processing by gulp-sass main.css on the output is read only.
This plugin receives a SASS
file
object then overrides itsfile.path
andfile.contents
properties.file.stat
is not touched. The plugin outputs the modified file object as CSS file. Writing the CSS file to file system, gulp.dest() usefile.stat
property to set attributes of a destination file if the property is not null. That's why main.css will read only if source file is read only.