npm

Need private packages and team management tools?Check out npm Orgs. »

gulp-parable

1.0.0 • Public • Published

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']);
});

Keywords

none

install

npm i gulp-parable

Downloadsweekly downloads

10

version

1.0.0

license

Apache-2.0

repository

Gitbitbucket

last publish

collaborators

  • avatar
  • avatar
  • avatar
Report a vulnerability