2015-04-02 22:53:11 -04:00
|
|
|
var gulp = require('gulp');
|
|
|
|
var concat = require('gulp-concat');
|
|
|
|
var replace = require('gulp-replace');
|
|
|
|
var insert = require('gulp-insert');
|
|
|
|
|
2015-04-13 19:48:04 -04:00
|
|
|
module.exports.bundle = function(buildConfig, moduleName, outputFile, outputConfig,
|
|
|
|
sfx) {
|
|
|
|
var sfx = sfx || false;
|
2015-03-23 16:18:05 -04:00
|
|
|
// loading it earlier interfers with custom traceur.
|
|
|
|
var Builder = require('systemjs-builder');
|
|
|
|
var builder = new Builder();
|
|
|
|
builder.config(buildConfig);
|
2015-04-13 19:48:04 -04:00
|
|
|
if (sfx) {
|
|
|
|
return builder.buildSFX(moduleName, outputFile, outputConfig);
|
|
|
|
} else {
|
|
|
|
return builder.build(moduleName, outputFile, outputConfig);
|
|
|
|
}
|
2015-03-23 16:18:05 -04:00
|
|
|
}
|
2015-04-02 22:53:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
module.exports.modify = function(srcs, concatName) {
|
|
|
|
return gulp.src(srcs)
|
|
|
|
.pipe(concat(concatName))
|
|
|
|
.pipe(replace('sourceMappingURL', 'sourceMappingURLDisabled')) // TODO: add concat for sourceMaps
|
|
|
|
}
|