0.3.0 • Published 10 years ago
gulp-streamlinejs v0.3.0
Notice
As of v0.2.0 this plugin only works with streamlinejs >= 1.x. Please lock to an older version to use streamlinejs <= 0.12.x.
Streamline Plugin for gulp
Supports all modes of streamlinejs (callbacks, fibers, generators, and fast mode of each, respectively)
Usage
var gulp = require('gulp');
var streamline = require('gulp-streamlinejs');
var insert = require('gulp-insert');
var paths = {
  streamlineSrc: [
    'streamline/**/*._coffee',
    'streamline/**/*.coffee',
    'streamline/**/*._js',
    'streamline/**/*.js'
  ],
};
/*
Compile streamline files with gulp-streamlinejs
*/
gulp.task('streamline', function() {
  gulp.src(paths.streamlineSrc)
    .pipe(streamline())
    .pipe(insert.prepend('/* I am at the top!*/\n'))
    .pipe(gulp.dest('./compiled'));
});Options
It will take all the standard options that the internal streamline transform and compile functions take. See here
Example:
Produce source maps
var sourcemaps = require('gulp-sourcemaps');
gulp.task('streamline', function() {
  gulp.src(paths.streamlineSrc)
  .pipe(sourcemaps.init())
  .pipe(streamline({
    sourceMap: 1
  }))
  .pipe(sourcemaps.write('./'))
  .pipe(gulp.dest('./compiled'));
});Note: sourcemaps: This follows the gulp-sourcemaps convention. It will apply a vinyl-sourcemaps-apply to the stream
with the sourcemap, if it is present.
Contributions
Any contributions welcome!