Skip to content

Commit 729b3ca

Browse files
committed
add .removeFile(type, filename)
1 parent 0edb59d commit 729b3ca

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/builder.js

+20
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,26 @@ Builder.prototype.addFile = function(type, filename, val){
301301
this._files[filename] = val;
302302
};
303303

304+
/**
305+
* Add remove file `type` `filename` so it does not become
306+
* part of the build output, for example when transpiling
307+
* "list.styl" in the `.styles` array to "list.css", otherwise
308+
* the contents of "list.styl" will become part of the output.
309+
*
310+
* @param {String} type
311+
* @param {String} filename
312+
* @param {String} val
313+
* @return {Type}
314+
* @api public
315+
*/
316+
317+
Builder.prototype.removeFile = function(type, filename){
318+
debug('remove %s "%s"', type, filename);
319+
var files = this.conf[type] || (this.conf[type] = []);
320+
var i = files.indexOf(filename);
321+
if (~i) files.splice(i, 1);
322+
};
323+
304324
/**
305325
* Append the given `str` of javascript.
306326
*

0 commit comments

Comments
 (0)