Skip to content
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

Newer not detecting changes when multiple files are used #18

Open
hutber opened this issue May 28, 2015 · 2 comments
Open

Newer not detecting changes when multiple files are used #18

hutber opened this issue May 28, 2015 · 2 comments

Comments

@hutber
Copy link

hutber commented May 28, 2015

I believe there might be something I am missing, but I've gone over it and can't see where it would be going wrong on my side.

    var changed    = require('gulp-changed');
    var newer = require('gulp-newer');
    var SRC = './stylesheets/**/*.scss';
    var DEST = './stylesheets';

    gulp.task('sass', function () {   
        return gulp.src(SRC)
            .pipe(changed(DEST)) //tried newer here as well 
            .pipe(sass())
            .pipe(gulp.dest(DEST))
    });

When changing a scss file it will output there has been a change but not change any scss

    [BS] Watching files...
    [09:26:13] Starting 'sass'...
    [09:26:14] Finished 'sass' after 180 ms

No sass file is output. Is there any way to output the timestamps? Or better still a verbose mode of some kind?

Thanks very much for making this :)

@Sawtaytoes
Copy link

I believe you need to change up your pipe.

gulp.task('sass', function () {   
    return gulp.src(SRC)
        .pipe(newer({
            dest: DEST,
            ext: '.css'
        }))
        .pipe(sass())
        .pipe(gulp.dest(DEST))
});

@tirmey
Copy link

tirmey commented Nov 13, 2017

Thank you, so much!!
The same concept can be applied to minified js files (extension .min.js)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants