Created
October 23, 2014 01:11
-
-
Save jwebcat/9ca388cf58262f444dc8 to your computer and use it in GitHub Desktop.
this is to run duo 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
/** | |
* Module Dependencies | |
*/ | |
var map = require('map-stream'); | |
var Duo = require('../../'); | |
var gulp = require('gulp'); | |
/** | |
* Default | |
*/ | |
gulp.task('default', ['scripts', 'styles']); | |
/** | |
* Scripts | |
*/ | |
gulp.task('scripts', function() { | |
gulp.src('home.js') | |
.pipe(duo()) | |
.pipe(gulp.dest('build')) | |
}) | |
/** | |
* Styles | |
*/ | |
gulp.task('styles', function() { | |
gulp.src('home.css') | |
.pipe(duo()) | |
.pipe(gulp.dest('build')) | |
}) | |
/** | |
* Duo | |
*/ | |
function duo(opts) { | |
opts = opts || {}; | |
return map(function(file, fn) { | |
Duo(file.base) | |
.entry(file.path) | |
.run(function(err, src) { | |
if (err) return fn(err); | |
file.contents = new Buffer(src); | |
fn(null, file); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment