Turbo87 / webpack-notifier

webpack + node-notifier = build status system notifications
ISC License
306 stars 41 forks source link

add support for title function for dynamic titles #53

Closed rkoval closed 4 years ago

rkoval commented 5 years ago

allows you to do something like this to show different titles for different conditions:

return new WebpackNotifierPlugin({
  title({msg}) {
    if (msg.startsWith('Error')) {
      return 'build error ❌';
    } else if (msg.startsWith('Warning')) {
      return 'build warning ⚠️';
    }
    return 'build complete ✅';
  },
});
rkoval commented 5 years ago

related to #48 i think

Evilart86 commented 5 years ago

ty for this feature! its actually what I wanted)

Gvozd commented 4 years ago

@rkoval Please rebase PR on current master, and update README.md After I will merge PR

Gvozd commented 4 years ago

Rebased manually, and updated the documentation v1.11.0