mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: properly fail prerender task (#5235)
* The prerender script that runs on the CI did not exit with a proper error-code when the `renderModuleFactory` failed due to errors like in #5233
This commit is contained in:
committed by
Jeremy Elbourn
parent
a2a25bead0
commit
1a03ee15b3
@@ -13,4 +13,9 @@ const result = renderModuleFactory(KitchenSinkServerModuleNgFactory, {
|
||||
document: readFileSync(join(__dirname, 'index.html'), 'utf-8')
|
||||
});
|
||||
|
||||
result.then(html => console.log(html));
|
||||
result
|
||||
.then(html => console.log(html))
|
||||
// If rendering the module factory fails, exit the process with an error code because otherwise
|
||||
// the CI task will not recognize the failure and will show as "success". The error message
|
||||
// will be printed automatically by the `renderModuleFactory` method.
|
||||
.catch(() => process.exit(1));
|
||||
|
||||
Reference in New Issue
Block a user