angular/integration/injectable-def/src/main.ts
Alan Agius 4798ec4166 fix(zone.js): add conditional exports to zone.js package (#51652)
This is needed to better support native ESM modules and avoid the otherwise necessary deep imports like `zone.js/fesm2015/zone-node.js` due to disallowed directory imports.

PR Close #51652
2023-09-06 16:37:26 +00:00

26 lines
673 B
TypeScript

import 'zone.js/node';
// Load the Angular compiler as we will rely on JIT compilation for this test.
// This test does not use the CLI and we are not processing the framework packages
// with the linker here.
import '@angular/compiler';
import {enableProdMode} from '@angular/core';
import {renderModule} from '@angular/platform-server';
import {AppModule} from './app.js';
enableProdMode();
renderModule(AppModule, {
document: '<test-app></test-app>',
url: '/',
}).then(html => {
if (/>0:0</.test(html)) {
process.exit(0);
} else {
console.error('html was', html);
process.exit(1);
}
}).catch(err => {
console.error(err);
process.exit(2);
})