X Tutup
Skip to content

Commit da4de21

Browse files
committed
fix(bundle): don’t bundle traceur/reflect into benchpress
Don’t need to bundle them as they are already present in G3.
1 parent eb0fd79 commit da4de21

File tree

2 files changed

+6
-29
lines changed

2 files changed

+6
-29
lines changed

gulpfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ var BENCHPRESS_BUNDLE_CONFIG = {
133133
entries: ['./dist/js/cjs/benchpress/index.js'],
134134
packageJson: './dist/js/cjs/benchpress/package.json',
135135
includes: [
136-
'angular2',
137-
'traceur',
138-
'reflect-metadata'
136+
'angular2'
139137
],
140138
excludes: [
139+
'traceur',
140+
'reflect-metadata',
141141
'selenium-webdriver',
142142
'rtts_assert',
143143
'zone.js'

tools/build/bundle.js

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,17 @@ module.exports.bundle = function(buildConfig, moduleName, outputFile, outputConf
1818
} else {
1919
return builder.build(moduleName, outputFile, outputConfig);
2020
}
21-
}
21+
};
2222

2323

2424
module.exports.modify = function(srcs, concatName) {
2525
return gulp.src(srcs)
2626
.pipe(concat(concatName))
2727
.pipe(replace('sourceMappingURL', 'sourceMappingURLDisabled')) // TODO: add concat for sourceMaps
28-
}
28+
};
2929

3030

3131
module.exports.benchpressBundle = function(entries, packageJsonPath, includes, excludes, ignore, dest, cb) {
32-
/*
33-
we need a script in dist/js/cjs so we
34-
can find node modules the same way benchpress does.
35-
This allows us to extract the LICENSE files from each
36-
module included in the bundle, through:
37-
helper(moduleName)
38-
*/
39-
var helperScript = 'module.exports = function(moduleName){return require.resolve(moduleName)}';
40-
var helperPath = path.resolve('./dist/js/cjs/_module_resolver.js');
41-
fs.writeFileSync(helperPath, helperScript);
42-
var helper = require(helperPath);
43-
4432
var b = browserify({
4533
entries: entries,
4634
builtins: [],
@@ -70,19 +58,8 @@ module.exports.benchpressBundle = function(entries, packageJsonPath, includes, e
7058
}
7159
var contents = buf.toString();
7260

73-
var licenses = "/*\n";
74-
//for packaged dependencies, the license must also be included
75-
for (var i = 0; i < includes.length; i++) {
76-
var licensePath = helper(includes[i] + "/LICENSE");
77-
var licenseContent = fs.readFileSync(licensePath);
78-
licenses += "======================== BEGIN LICENSE FOR BUNDLED MODULE: " + includes[i] + " ========================\n";
79-
licenses += licenseContent;
80-
licenses += "======================== END LICENSE FOR BUNDLED MODULE: " + includes[i] + " ========================\n";
81-
}
82-
licenses += "*/\n";
83-
contents = licenses + contents;
8461
contents += 'module.exports = global.__benchpressExports;\n';
8562
fs.writeFileSync(dest + '/index.js', contents);
8663
cb(null);
8764
});
88-
}
65+
};

0 commit comments

Comments
 (0)
X Tutup