Skip to content

Instantly share code, notes, and snippets.

@dgieselaar
Created March 23, 2015 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgieselaar/39c9ad1528c82de69f73 to your computer and use it in GitHub Desktop.
Save dgieselaar/39c9ad1528c82de69f73 to your computer and use it in GitHub Desktop.
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