Skip to content

Commit 03a2b27

Browse files
authored
feat: added --client-overlay flag (#3148)
1 parent d9a1cec commit 03a2b27

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ Options:
9393
--no-http2 Do not use HTTP/2.
9494
--bonjour Broadcasts the server via ZeroConf networking on start.
9595
--client-progress Print compilation progress in percentage in the browser.
96+
--client-overlay Show a full-screen overlay in the browser when there are compiler errors or warnings.
97+
--no-client-overlay Do not show a full-screen overlay in the browser when there are compiler errors or warnings.
9698
--setup-exit-signals Close and exit the process on SIGINT and SIGTERM.
9799
--no-setup-exit-signals Do not close and exit the process on SIGNIT and SIGTERM.
98100
--open [value] Open the default browser, or optionally specify a browser name.

bin/cli-flags.js

+18
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ module.exports = {
9898
delete opts.clientProgress;
9999
},
100100
},
101+
{
102+
name: 'client-overlay',
103+
type: Boolean,
104+
configs: [
105+
{
106+
type: 'boolean',
107+
},
108+
],
109+
description:
110+
'Show a full-screen overlay in the browser when there are compiler errors or warnings.',
111+
negatedDescription:
112+
'Do not show a full-screen overlay in the browser when there are compiler errors or warnings.',
113+
processor(opts) {
114+
opts.client = opts.client || {};
115+
opts.client.overlay = opts.clientOverlay;
116+
delete opts.clientOverlay;
117+
},
118+
},
101119
{
102120
name: 'setup-exit-signals',
103121
type: Boolean,

test/cli/cli.test.js

+9
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,15 @@ describe('CLI', () => {
291291
.catch(done);
292292
});
293293

294+
it('--client-overlay', (done) => {
295+
testBin('--client-overlay')
296+
.then((output) => {
297+
expect(output.exitCode).toEqual(0);
298+
done();
299+
})
300+
.catch(done);
301+
});
302+
294303
it('should log public path', (done) => {
295304
testBin(
296305
'--no-color',

0 commit comments

Comments
 (0)