Skip to content

Commit

Permalink
Add javascript task
Browse files Browse the repository at this point in the history
  • Loading branch information
gisostallenberg committed Feb 4, 2016
1 parent e9dc7bb commit 4c2de10
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tasks/javascript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'use strict';

module.exports = function (gulp, config, plugins) {
return function () {
config.javascript.items.forEach(function(item) {

if (typeof plugins['include'] == 'undefined') {
plugins['include'] = plugins.nop;
}

return gulp.src(item.src)
.pipe(plugins.sourcemaps.init())
.pipe(plugins.concat(item.outputname))
.pipe(plugins.include() )
.pipe(
plugins.if(config.production,
plugins.uglify(item.options),
plugins.sourcemaps.write('../maps')
)
)
.pipe(gulp.dest(item.dest))
.pipe(plugins.livereload());
});
};
};

0 comments on commit 4c2de10

Please sign in to comment.