Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.

Commit 9452e33

Browse files
author
dmerc
committed
Add option to use browserify.ignore()
1 parent 63855a2 commit 9452e33

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ tree = browserify(tree, options);
3131
* `outputFile`: (default `"./browserify.js"`) Output file
3232
* `browserify` : (default `{}`) Options passed to the [browserify constructor](https://github.com/substack/node-browserify#var-b--browserifyfiles-or-opts)
3333
* `bundle`: (default `{}`) Options passed to [browserify bundle method](https://github.com/substack/node-browserify#bbundleopts-cb)
34-
* `require`: (default []) An array of file, option pairs
35-
passed to [browserify require
36-
method](https://github.com/substack/node-browserify#brequirefile-opts)
34+
* `require`: (default []) An array of file, option pairs passed to [browserify require method](https://github.com/substack/node-browserify#brequirefile-opts)
35+
* `ignore`: (default []) An array of file, option pairs passed to [browserify ignore method](https://github.com/substack/node-browserify#bignorefile)
3736

3837
## Changelog
3938

lib/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function BrowserifyWriter(inputTree, options) {
1717
this.browserifyOptions = options.browserify || {};
1818
this.bundleOptions = options.bundle || {};
1919
this.requireOptions = options.require || {};
20+
this.ignoreOptions = options.ignore || [];
2021
this.inputTree = inputTree;
2122
}
2223

@@ -42,6 +43,9 @@ BrowserifyWriter.prototype.write = function (readTree, destDir) {
4243
for(var i = 0; i < requireOptions.length; i++){
4344
b.require.apply(b, requireOptions[i]);
4445
}
46+
for(var i = 0; i < ignoreOptions.length; i++){
47+
b.ignore(ignoreOptions[i]);
48+
}
4549

4650
return new RSVP.Promise(function (resolve, reject) {
4751
b.bundle(bundleOptions, function (err, data) {

0 commit comments

Comments
 (0)