Combine nodes yielding a transform node made up of files belonging to one and only one of the input nodes.
npm install --save-dev broccoli-tree-difference
var TreeDifference = require('broccoli-tree-difference');
var difference = new TreeDifference(inputNodes, options);
-
inputNodes
: An array of nodes, whose contents will be merged -
options
: A hash of options
annotation
: A note to help tell multiple plugin instances apart.
If this is your Brocfile.js
:
var TreeDifference = require('broccoli-tree-difference');
vat Funnel = require('broccoli-funnel');
module.exports = new TreeDifference(['public', new Funnel('public', { srcDir: 'images', destDir: 'images' })]);
And your project contains these files:
.
├─ public
│ ├─ index.html
│ └─ images
│ └─ logo.png
…
Then running broccoli build the-output
will generate this folder:
the-output
└─ index.html
This is a pretty pedantic example, but here we're taking the difference of a tree and one of its subtrees.
Clone this repo and run the tests like so:
npm install
npm test
Issues and pull requests are welcome. If you change code, be sure to re-run
npm test
. Oftentimes it's useful to add or update tests as well.