diff --git a/gulpfile.js b/gulpfile.js index 48540ddc72..a57d90b74b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -133,11 +133,11 @@ var BENCHPRESS_BUNDLE_CONFIG = { entries: ['./dist/js/cjs/benchpress/index.js'], packageJson: './dist/js/cjs/benchpress/package.json', includes: [ - 'angular2', - 'traceur', - 'reflect-metadata' + 'angular2' ], excludes: [ + 'traceur', + 'reflect-metadata', 'selenium-webdriver', 'rtts_assert', 'zone.js' diff --git a/tools/build/bundle.js b/tools/build/bundle.js index 9e7c0572d9..3d3faf2c84 100644 --- a/tools/build/bundle.js +++ b/tools/build/bundle.js @@ -18,29 +18,17 @@ module.exports.bundle = function(buildConfig, moduleName, outputFile, outputConf } else { return builder.build(moduleName, outputFile, outputConfig); } -} +}; module.exports.modify = function(srcs, concatName) { return gulp.src(srcs) .pipe(concat(concatName)) .pipe(replace('sourceMappingURL', 'sourceMappingURLDisabled')) // TODO: add concat for sourceMaps -} +}; module.exports.benchpressBundle = function(entries, packageJsonPath, includes, excludes, ignore, dest, cb) { - /* - we need a script in dist/js/cjs so we - can find node modules the same way benchpress does. - This allows us to extract the LICENSE files from each - module included in the bundle, through: - helper(moduleName) - */ - var helperScript = 'module.exports = function(moduleName){return require.resolve(moduleName)}'; - var helperPath = path.resolve('./dist/js/cjs/_module_resolver.js'); - fs.writeFileSync(helperPath, helperScript); - var helper = require(helperPath); - var b = browserify({ entries: entries, builtins: [], @@ -70,19 +58,8 @@ module.exports.benchpressBundle = function(entries, packageJsonPath, includes, e } var contents = buf.toString(); - var licenses = "/*\n"; - //for packaged dependencies, the license must also be included - for (var i = 0; i < includes.length; i++) { - var licensePath = helper(includes[i] + "/LICENSE"); - var licenseContent = fs.readFileSync(licensePath); - licenses += "======================== BEGIN LICENSE FOR BUNDLED MODULE: " + includes[i] + " ========================\n"; - licenses += licenseContent; - licenses += "======================== END LICENSE FOR BUNDLED MODULE: " + includes[i] + " ========================\n"; - } - licenses += "*/\n"; - contents = licenses + contents; contents += 'module.exports = global.__benchpressExports;\n'; fs.writeFileSync(dest + '/index.js', contents); cb(null); }); -} +};