-
Notifications
You must be signed in to change notification settings - Fork 137
/
index.js
24 lines (20 loc) · 835 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// From https://github.com/cardstack/boxel/blob/d54f834f/packages/host/lib/with-side-watch.js (MIT license)
const mergeTrees = require('broccoli-merge-trees');
const { WatchedDir } = require('broccoli-source');
const Plugin = require('broccoli-plugin');
class BroccoliNoOp extends Plugin {
constructor(path) {
super([new WatchedDir(path)]);
}
build() {}
}
/*
Doesn't change your actualTree, but causes a rebuild when any of opts.watching
trees change.
This is helpful when your build pipeline doesn't naturally watch some
dependencies that you're actively developing. For example, right now
@embroider/webpack doesn't rebuild itself when non-ember libraries change.
*/
module.exports = function sideWatch(actualTree, opts) {
return mergeTrees([actualTree, ...opts.watching.map(w => new BroccoliNoOp(w))]);
};