alloc / cush

WIP module bundler 🎁
MIT License
0 stars 0 forks source link

package.json diff events #30

Open aleclarson opened 5 years ago

aleclarson commented 5 years ago

Plugins may want to know what properties changed in the package.json of a package.

We could perform a "deep diff" on the module and emit that with a package:config event. And if nothing changed, the event can be skipped.

this.hook('package:config', (pack, diff) => {
  if (diff.postcss) // reconfigure the package
});

We could also expose the diffing function as cush/utils/diff so plugins can use it on their own configuration files.