2014-12-05 19:26:30 -05:00
|
|
|
var util = require('./util');
|
|
|
|
var gulpTraceur = require('../transpiler/gulp-traceur');
|
|
|
|
var file2moduleName = require('./file2modulename');
|
|
|
|
var mergeStreams = require('event-stream').merge;
|
|
|
|
|
|
|
|
module.exports = function(gulp, plugins, config) {
|
|
|
|
return function() {
|
|
|
|
var transpile = gulp.src(config.src)
|
|
|
|
.pipe(plugins.rename({extname: '.'+config.outputExt}))
|
2015-02-02 19:25:34 -05:00
|
|
|
.pipe(util.insertSrcFolder(plugins, config.srcFolderInsertion, config.modulesFolder))
|
2014-12-05 19:26:30 -05:00
|
|
|
.pipe(gulpTraceur(
|
|
|
|
config.options,
|
|
|
|
file2moduleName)
|
|
|
|
)
|
|
|
|
.pipe(gulp.dest(config.dest));
|
|
|
|
|
|
|
|
var copy = gulp.src(config.copy)
|
|
|
|
.pipe(plugins.rename({extname: '.'+config.outputExt}))
|
2015-02-02 19:25:34 -05:00
|
|
|
.pipe(util.insertSrcFolder(plugins, config.srcFolderInsertion, config.modulesFolder))
|
2014-12-05 19:26:30 -05:00
|
|
|
.pipe(gulp.dest(config.dest));
|
|
|
|
|
|
|
|
return mergeStreams(transpile, copy);
|
|
|
|
};
|
|
|
|
};
|