1 | import NotifierPlugin from 'webpack-notifier';
|
2 | export default class NotificationPack {
|
3 | constructor(options = {}) {
|
4 | this.defaults = {
|
5 | alwaysNotify: false,
|
6 | excludeWarnings: true,
|
7 | };
|
8 | this.configuration = {
|
9 | plugins: [],
|
10 | };
|
11 | this.options = {
|
12 | ...this.defaults,
|
13 | ...options,
|
14 | };
|
15 | }
|
16 | generate(options, hints) {
|
17 | if (hints.notify) {
|
18 | const plugin = new NotifierPlugin(this.options);
|
19 | this.configuration.plugins.push(plugin);
|
20 | }
|
21 | return this.configuration;
|
22 | }
|
23 | }
|
24 |
|
\ | No newline at end of file |