Skip to content

Commit 00bea83

Browse files
authored
fix: TS warnings/errors hidden by console clearing (#1635)
1 parent 0e87533 commit 00bea83

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.changeset/few-carrots-laugh.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'preact-cli': patch
3+
---
4+
5+
Ensures TS warnings/errors are not hidden by console clearing

packages/cli/lib/lib/webpack/run-webpack.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ async function devBuild(env) {
3333
callback();
3434
});
3535

36+
compiler.hooks.beforeCompile.tap('CliDevPlugin', () => {
37+
if (env['clear']) clear(true);
38+
});
39+
3640
compiler.hooks.done.tap('CliDevPlugin', stats => {
3741
let devServer = config.devServer;
3842
let protocol = process.env.HTTPS || devServer.https ? 'https' : 'http';
@@ -43,8 +47,6 @@ async function devBuild(env) {
4347
let serverAddr = `${protocol}://${host}:${bold(env.port)}`;
4448
let localIpAddr = `${protocol}://${ip.address()}:${bold(env.port)}`;
4549

46-
if (env['clear']) clear(true);
47-
4850
if (stats.hasErrors()) {
4951
process.stdout.write(red('Build failed!\n\n'));
5052
} else {

0 commit comments

Comments
 (0)