Skip to content

Commit ea8cf39

Browse files
committed
#824 Added ability to disable success notifications and only show errors, and a single success if the previous build was failing.
1 parent e5e0cbc commit ea8cf39

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

src/Api.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,15 @@ class Api {
382382
Config.notifications = false;
383383

384384
return this;
385-
}
385+
};
386+
387+
/**
388+
* Disable success notifications.
389+
*/
390+
disableSuccessNotifications() {
391+
Config.notificationsOnSuccess = false;
392+
return this;
393+
};
386394

387395

388396
/**

src/builder/webpack-plugins.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = function () {
5454
plugins.push(
5555
new WebpackNotifierPlugin({
5656
title: 'Laravel Mix',
57-
alwaysNotify: true,
57+
alwaysNotify: Mix.isUsing('notificationsOnSuccess'),
5858
contentImage: Mix.paths.root('node_modules/laravel-mix/icons/laravel.png')
5959
})
6060
);

src/config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,21 @@ module.exports = function () {
121121

122122

123123
/**
124-
* Determine if notifications should be displayed for each build.
124+
* Determine if error notifications should be displayed for each build.
125125
*
126126
* @type {Boolean}
127127
*/
128128
notifications: true,
129129

130130

131+
/**
132+
* Determine if we should always show success notifications.
133+
*
134+
* @type {Boolean}
135+
*/
136+
notificationsOnSuccess: true,
137+
138+
131139
/**
132140
* Determine if sourcemaps should be created for the build.
133141
*

0 commit comments

Comments
 (0)