Closed aleclarson closed 6 years ago
We need to figure out how to accomplish this with hookModules
and hookPackages
.
Added in 7a6d87e37bc84adf9e5edd39a02d0c951de079de (v0.1.0)
For the module hook, you can do:
this.hookLeft('module.js', () => {});
For the package hook, you can do:
this.hookLeft('package', () => {});
Currently, the hook API for plugins is very minimal. Hook functions are pushed to the end of the associated array. We'll probably keep
this.hook
the same in that regard, but we should figure out a way to prepend a hook function (and maybe even a priority system is warranted?).Using
hookLeft
guarantees your function will run before anyhook
andhookRight
functions.Using
hookRight
guarantees your function will run after anyhook
andhookLeft
functions.