Skip to content

Commit fcf85c2

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

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

lib/Server.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,10 +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

705+
// TODO: change condition at major version
701706
if (this.options.liveReload !== false) {
702707
this.sockWrite([connection], 'liveReload', this.options.liveReload);
703708
}
@@ -710,10 +715,6 @@ class Server {
710715
this.sockWrite([connection], 'overlay', this.clientOverlay);
711716
}
712717

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

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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
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.",

test/fixtures/contentbase-config/public/node_modules/index.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)