Skip to content

Commit 239150a

Browse files
committed
fix(server): change clientLogLevel order to be called first
1 parent 9582418 commit 239150a

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

lib/Server.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -694,11 +694,15 @@ class Server {
694694
}
695695
});
696696

697+
if (this.clientLogLevel) {
698+
this.sockWrite([connection], 'log-level', this.clientLogLevel);
699+
}
700+
697701
if (this.hot) {
698702
this.sockWrite([connection], 'hot');
699703
}
700704

701-
if (this.options.liveReload !== false) {
705+
if (this.options.liveReload) {
702706
this.sockWrite([connection], 'liveReload', this.options.liveReload);
703707
}
704708

@@ -710,10 +714,6 @@ class Server {
710714
this.sockWrite([connection], 'overlay', this.clientOverlay);
711715
}
712716

713-
if (this.clientLogLevel) {
714-
this.sockWrite([connection], 'log-level', this.clientLogLevel);
715-
}
716-
717717
if (!this._stats) {
718718
return;
719719
}

test/e2e/ClientOptions.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ describe('Client console.log', () => {
250250
liveReload: true,
251251
},
252252
},
253+
{
254+
title: 'clientLogLevel is silent',
255+
options: {
256+
clientLogLevel: 'silent',
257+
},
258+
},
253259
];
254260

255261
for (const { title, options } of cases) {

test/e2e/__snapshots__/ClientOptions.test.js.snap

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
exports[`Client console.log clientLogLevel is silent 1`] = `
4+
Array [
5+
"Hey.",
6+
]
7+
`;
8+
39
exports[`Client console.log hot disabled 1`] = `
410
Array [
511
"Hey.",
6-
"[WDS] Live Reloading enabled.",
712
]
813
`;
914

@@ -12,7 +17,6 @@ Array [
1217
"[HMR] Waiting for update signal from WDS...",
1318
"Hey.",
1419
"[WDS] Hot Module Replacement enabled.",
15-
"[WDS] Live Reloading enabled.",
1620
]
1721
`;
1822

0 commit comments

Comments
 (0)