File tree 1 file changed +5
-0
lines changed 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ function BrowserifyWriter(inputTree, options) {
16
16
this . outputFile = options . outputFile || '/browserify.js' ;
17
17
this . browserifyOptions = options . browserify || { } ;
18
18
this . bundleOptions = options . bundle || { } ;
19
+ this . requireOptions = options . require || { } ;
19
20
this . inputTree = inputTree ;
20
21
}
21
22
@@ -27,6 +28,7 @@ BrowserifyWriter.prototype.write = function (readTree, destDir) {
27
28
var outputFile = this . outputFile ;
28
29
var browserifyOptions = this . browserifyOptions ;
29
30
var bundleOptions = this . bundleOptions ;
31
+ var requireOptions = this . requireOptions ;
30
32
31
33
return readTree ( this . inputTree ) . then ( function ( srcDir ) {
32
34
mkdirp . sync ( path . join ( destDir , path . dirname ( outputFile ) ) ) ;
@@ -37,6 +39,9 @@ BrowserifyWriter.prototype.write = function (readTree, destDir) {
37
39
for ( var i = 0 ; i < entries . length ; i ++ ) {
38
40
b . add ( entries [ i ] ) ;
39
41
}
42
+ for ( var i = 0 ; i < requireOptions . length ; i ++ ) {
43
+ b . require . apply ( b , requireOptions [ i ] ) ;
44
+ }
40
45
41
46
return new RSVP . Promise ( function ( resolve , reject ) {
42
47
b . bundle ( bundleOptions , function ( err , data ) {
You can’t perform that action at this time.
0 commit comments