I'm building a few sites and am using Gulp to compile their .scss files into a main.css
file.
Things are working fine but for one thing - Gulp doesn't seem to know when main.css
file has been updated.
For example, if I run gulp sass
and compile my main.css
file, then run my FTP deploy script, gulp ftp-deploy
, the .scss files (and any other .html or .php files I've been working on) will deploy, but not the main.css
file.
Gulp will only recognise if there is a change in main.css
if I open it in my IDE, make an alteration like adding a space or something, then save.
The above problem also happens when I run Shopify ThemeKit's theme watch
command as well.
Would anyone know how I could make it so changes are detected?
My gulpfile.js is as such:
const gulp = require('gulp');
const sass = require('gulp-sass'); //Compiles SASS
const ftp = require( 'vinyl-ftp' ); //FTP
gulp.task('sass', function(){
return gulp.src('scss/main.scss')
.pipe(sass())
.pipe(gulp.dest('css'))
});
gulp.task('ftp-deploy', function() {
var conn = ftp.create({
// CONFIG
});
var localFilesGlob = ['css/**'];
return gulp.src(localFilesGlob, { base: '.', buffer: false })
.pipe( conn.newer( '.' ) )
.pipe( conn.dest( '.' ) )
;
});
Additional info
node.js version is 11.6.0
npm version is 6.5.0
Gulp version is 4.0.0 (2.0.1 CLI)
I on MacOS 10.14.2