Last active
August 29, 2015 14:04
-
-
Save yocontra/1354af0114783766ba5e to your computer and use it in GitHub Desktop.
use pipelines with gulp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var buffer = require('vinyl-buffer'); | |
var source = require('vinyl-source-stream'); | |
var browserify = require('browserify'); | |
var uglify = require('gulp-uglify'); | |
gulp.task('index', function(){ | |
var bundler = browserify('newstimeline/livescript/index.ls'); | |
bundler.transform('browserify-livescript'); | |
return bundler.bundle({insertGlobals: true}) | |
.pipe(source('index.js')) | |
.pipe(buffer()) | |
.pipe(uglify()) // just an example, remove if you dont need it | |
.pipe(gulp.dest('newstimeline/static/js')); | |
}); | |
gulp.task('management', function(){ | |
var bundler = browserify('newstimeline/livescript/management.ls'); | |
bundler.transform('browserify-livescript'); | |
return bundler.bundle({insertGlobals: true}) | |
.pipe(source('management.js')) | |
.pipe(buffer()) | |
.pipe(uglify()) // just an example, remove if you dont need it | |
.pipe(gulp.dest('newstimeline/static/js')); | |
}); | |
gulp.task('default', ['index', 'management']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var ls = require('gulp-livescript'); | |
var browserify = require('gulp-browserify'); | |
gulp.task('ls', function() { | |
return gulp.src('newstimeline/livescript/*.js') | |
.pipe(ls({bare: true})) | |
.pipe(gulp.dest('build/js/')) | |
}); | |
gulp.task('index', ['ls'], function() { | |
return gulp.src('build/js/index.js') | |
.pipe(browserify({insertGlobals : true})) | |
.pipe(gulp.dest('newstimeline/static/js/')) | |
}); | |
gulp.task('management', ['ls'], function() { | |
return gulp.src('build/js/management.js') | |
.pipe(browserify({insertGlobals : true})) | |
.pipe(gulp.dest('newstimeline/static/js/')) | |
}); | |
gulp.task('default', ['index', 'management']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment