@@ -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
2424module . 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
3131module . 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