chore: clean up HMR runtime

This commit is contained in:
Igor Randjelovic
2021-03-28 19:39:22 +02:00
parent b2a636e307
commit 6dc0c7e285
3 changed files with 90 additions and 38 deletions

View File

@@ -1,6 +1,7 @@
import { env } from "../";
const id = 'WatchStatePlugin';
const version = 1;
const DEBUG = false;
export enum messages {
compilationComplete = 'Webpack compilation complete.',
@@ -23,7 +24,7 @@ export class WatchStatePlugin {
if (isWatchMode) {
console.log(messages.changeDetected);
if (DEBUG) {
if (env.verbose) {
if (compiler.modifiedFiles) {
Array.from(compiler.modifiedFiles).forEach(file => {
console.log(`MODIFIED: ${file}`)
@@ -80,7 +81,7 @@ export class WatchStatePlugin {
}
function notify(message: any) {
DEBUG && console.log(`[${id}] Notify: `, message);
env.verbose && console.log(`[${id}] Notify: `, message);
if (!process.send) {
return;
}