File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1- import 'reflect-metadata' ;
2- import 'zone.js' ;
3-
41import { enableProdMode } from '@angular/core' ;
52import { renderModuleFactory } from '@angular/platform-server' ;
6- import { join } from 'path' ;
7- import { readFileSync } from 'fs-extra' ;
3+ import { readFileSync , writeFileSync } from 'fs-extra' ;
84import { log } from 'gulp-util' ;
5+ import { join } from 'path' ;
6+ import 'reflect-metadata' ;
7+ import 'zone.js' ;
98import { KitchenSinkServerModuleNgFactory } from './kitchen-sink/kitchen-sink.ngfactory' ;
109
1110enableProdMode ( ) ;
@@ -15,7 +14,10 @@ const result = renderModuleFactory(KitchenSinkServerModuleNgFactory, {
1514} ) ;
1615
1716result
18- . then ( ( ) => log ( 'Prerender done.' ) )
17+ . then ( content => {
18+ writeFileSync ( join ( __dirname , 'index-prerendered.html' ) , content , 'utf-8' ) ;
19+ log ( 'Prerender done.' ) ;
20+ } )
1921 // If rendering the module factory fails, exit the process with an error code because otherwise
2022 // the CI task will not recognize the failure and will show as "success". The error message
2123 // will be printed automatically by the `renderModuleFactory` method.
You can’t perform that action at this time.
0 commit comments