L
L
Lenar Fattakhov2016-01-14 11:09:51
gulp.js
Lenar Fattakhov, 2016-01-14 11:09:51

How to not rebuild files in browserify that haven't changed?

In gallp I have a task that collects all scripts via browserify. But the problem is that I have several js files going, and just a little, everything is rebuilt. This is starting to take too long, and I thought, is there any way to avoid this? I tried using watchify but it didn't seem to help. The task itself looks something like this

watchify(browserify({
        entries: './src/js/script/index.coffee',
        debug: true,
        transform: ['jadeify','coffeeify'],
        extensions: ['.coffee', '.jade']
    })).bundle().pipe(source('index.coffee'))
        .pipe(rename('index.js'))
        .pipe(convertEncoding({to: 'utf-8'}))
        .pipe(gulp.dest(BUILDPATH+'js/'))
        .pipe(browserSync.stream());

    watchify(browserify({
        entries: './src/js/script/intro.coffee',
        debug: true,
        transform: ['jadeify','coffeeify'],
        extensions: ['.coffee', '.jade']
    })).bundle().pipe(source('intro.coffee'))
        .pipe(rename('intro.js'))
        .pipe(convertEncoding({to: 'utf-8'}))
        .pipe(gulp.dest(BUILDPATH+'js/'))
        .pipe(browserSync.stream());

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question