gulp.task( 'js:vendor', [], function () {
return gulp.src( [
'./node_modules/jquery/dist/jquery.min.js',
'./node_modules/sortablejs/Sortable.min.js',
'./node_modules/jquery-sparkline/jquery.sparkline.min.js'
] )
.pipe( sourcemaps.init() )
.pipe( plumber() )
.pipe( concat( 'vendor.min.js' ) )
.pipe( plumber.stop() )
.pipe( gulp.dest( paths.dist.js ) );
} );
gulp.task( 'js:app', [], function () {
return gulp.src( [
paths.src.js + '/**/*.js'
] )
.pipe( sourcemaps.init() )
.pipe( plumber() )
.pipe( concat( 'app.js' ) )
.pipe( gulp.dest( paths.dist.js ) )
.pipe( rename( 'app.min.js' ) )
.pipe( uglify() )
.pipe( sourcemaps.write( '.' ) )
.pipe( plumber.stop() )
.pipe( gulp.dest( paths.dist.js ) );
} );
gulp.task( 'vendor', [ 'js:vendor' ] );
gulp.task( 'app', [ 'js:app' ] );
gulp.task( 'default', function () {
gulp.watch( paths.src.js + '/**/*.js', [ 'js:app' ] );
} );