Skip to content

Commit

Permalink
feat: beautify error reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
swashata committed Oct 22, 2018
1 parent 4faf10e commit c068758
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@types/webpack": "^4.4.13",
"@types/webpack-assets-manifest": "^3.0.0",
"@types/webpack-dev-middleware": "^2.0.2",
"@types/webpack-env": "^1.13.6",
"@types/webpack-hot-middleware": "^2.16.4",
"@wpackio/babel-preset-base": "^1.2.0",
"autoprefixer": "^9.1.5",
Expand Down
5 changes: 4 additions & 1 deletion packages/scripts/src/bin/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ export function serve(options: ProgramOptions | undefined): void {
onError: msg => {
spinner.stop();
clearConsole();
console.log(`${chalk.bgRed.black(' ERROR ')} please review`);
console.log('');
msg.errors.forEach(e => console.log(e));
console.log('');
console.error(
`${logSymbols.error} ${chalk.dim('failed to compile')}\n`
);
msg.errors.forEach(e => console.log(e));
console.log(
`${watchSymbol} watching for changes${watchEllipsis}`
);
Expand Down
4 changes: 4 additions & 0 deletions packages/scripts/src/config/WebpackConfigHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ export class WebpackConfigHelper {
tslint: undefined,
async: false,
silent: true,
formatter: 'codeframe',
formatterOptions: {
highlightCode: true,
},
})
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/src/entrypoint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///<reference types="webpack-env" />
// We expect __webpack_public_path__ to be present, thanks to webpack
declare let __webpack_public_path__: string | undefined;
declare const __WPACKIO__: { appName: string; outputPath: string } | undefined;

// We are not using DOM in the typescript library, so let's just hack our way
Expand Down

0 comments on commit c068758

Please sign in to comment.