Created
March 23, 2015 07:15
-
-
Save dgieselaar/39c9ad1528c82de69f73 to your computer and use it in GitHub Desktop.
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
function js ( ) { | |
var stream = gulp.src([ 'src/**/_*.js', 'src/**/*.js' ] ) | |
.pipe(sourcemaps.init()) | |
.pipe(cached('js')) | |
.pipe(plumber()) | |
.pipe(babel( { | |
blacklist: [ "useStrict" ], | |
babelHelpers: { | |
outputType: 'var' | |
} | |
}, './helpers.js', './helpers.js')) | |
.pipe(uglify()) | |
.pipe(remember('js')) | |
.pipe(concat('vorm.js', { newLine: '' })) | |
.pipe(sourcemaps.write('.')) | |
.pipe(gulp.dest('.')); | |
return stream; | |
} | |
gulp.task('js', js); | |
gulp.task('helper', function ( ) { | |
var stream = gulp.src('./helpers.js') | |
.pipe(uglify()) | |
.pipe(addsrc.append('./vorm.js')) | |
.pipe(concat('vorm.js', { newLine: ''})) | |
.pipe(header('"use strict";')) | |
.pipe(gulp.dest('.')); | |
stream.on('end', function ( ) { | |
fs.unlinkSync('./helpers.js'); | |
}); | |
return stream; | |
}) | |
gulp.task('build', function ( ) { | |
runSequence('js', 'helper'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment