Skip to content

Commit 962c9bf

Browse files
authored
Merge pull request mui#5 from nytpi/feature/notify-enhancement
adds extensions to the development notifier. adds ignore for IntelliJ based IDEs.
2 parents fc12d7a + ad718f4 commit 962c9bf

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ node_modules
4444

4545
# Debug log from npm
4646
npm-debug.log
47+
.idea

devServer.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ const express = require('express');
88
const createWebpackMiddleware = require('webpack-dev-middleware');
99
const createWebpackHotMiddleware = require('webpack-hot-middleware');
1010

11-
function createNotification(subject, msg) {
11+
function createNotification(subject, msg, open) {
1212
const title = `🔥 ${subject.toUpperCase()}`;
1313

14-
notifier.notify({
14+
var notifyProps = {
1515
title,
16-
message: msg,
17-
});
16+
message: msg
17+
};
18+
19+
if (typeof open === "string") {
20+
notifyProps.open = open;
21+
}
22+
23+
notifier.notify(notifyProps);
1824

1925
console.log(`==> ${title} -> ${msg}`);
2026
}
@@ -71,7 +77,7 @@ class HotServer {
7177
// requiring it. It returns the http listener too.
7278
this.listenerManager = new ListenerManager(require(compiledOutputPath).default);
7379

74-
createNotification('server', ' Running');
80+
createNotification('server', '🌎 Running', `http://localhost:${process.env.SERVER_PORT}`);
7581
} catch (err) {
7682
createNotification('server', '😵 Bundle invalid, check console for error');
7783
console.log(err);

0 commit comments

Comments
 (0)