generated from jeffreybernadas/react-library-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompilation.config.js
31 lines (28 loc) · 923 Bytes
/
compilation.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const printCompilationMessage = (status, port) => {
let messageColor, messageType, browserMessage;
switch (status) {
case "success":
messageColor = "\x1b[32m";
messageType = "Compiled successfully!";
browserMessage = "You can now view";
break;
case "failure":
messageColor = "\x1b[31m";
messageType = "Compilation Failed!";
browserMessage = "You can't now view";
break;
case "compiling":
messageColor = "\x1b[94m";
messageType = "Compiling...";
browserMessage = "Compiling the";
break;
}
console.log(`\n\n
${messageColor}${messageType}\x1b[0m\n
${browserMessage} \x1b[1mRemote\x1b[0m in the browser.
${messageColor}${messageType}\x1b[0m\n
\x1b[1mLocal\x1b[0m: http://localhost:\x1b[1m${port}\x1b[0m
\x1b[1mLocal\x1b[0m: http://localhost:\x1b[1m${port}\x1b[0m\n\n
`);
};
module.exports = printCompilationMessage;