1.0.0 • Published 6 years ago

gulp-parable v1.0.0

Weekly downloads
1
License
Apache-2.0
Repository
bitbucket
Last release
6 years ago

Parable Gulp Task

Gulp task for use with Parable. See the Parable README for more information about the options you can pass to Parable.

This documentation is still a work in progress.

Usage

Gulp only processes a single file at a time, so to take advantage of Parable the pattern to use is to precompile with Parable, to get the parallelisation benefits on all the files, and then for individual files use Parable to (hopefully) just return the file that was cached.

const gulp = require('gulp');
const parable = require('gulp-parable');

const parableOpts = {
    base: 'src',
    outputDir: 'target/parable',
    babelOptions: {
        // ...
    }
};

const JS_GLOB = ['src/**/*.js'];

gulp.task('precompile-js', parable.precompile(JS_GLOB, parableOpts));

gulp.task('js', ['precompile-js'], function (cb) {
    return gulp.src(JS_GLOB)
        .pipe(parable.transform(parableOpts))
        .on('error', function (error) {
            parable.logError(error);
            cb(new Error('unable to transpile ' + error.filename));
        })
        .pipe(gulp.dest('target'));
});

gulp.task('watch', ['js'], function () {
    gulp.watch([JS_GLOB], ['js']);
});
1.0.0

6 years ago

0.6.0

7 years ago

1.0.0-beta.0

8 years ago

0.5.2

8 years ago

0.5.1

8 years ago

0.5.0

9 years ago

0.4.1-beta.1

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago