Skip to content

Instantly share code, notes, and snippets.

@alexzuza
Created July 8, 2019 05:14
Show Gist options
  • Save alexzuza/15f713334a225937bf3547102d5cbe10 to your computer and use it in GitHub Desktop.
Save alexzuza/15f713334a225937bf3547102d5cbe10 to your computer and use it in GitHub Desktop.
t5
const { AngularCompilerPlugin } = require('./node_modules/@ngtools/webpack/src/angular_compiler_plugin.js');
const old = AngularCompilerPlugin.prototype._createOrUpdateProgram;
AngularCompilerPlugin.prototype._createOrUpdateProgram = async function() {
await old.apply(this, arguments);
const sourceFile = this._program.tsProgram.getSourceFiles().find(sf => sf.fileName.endsWith('app.module.ngfactory.ts'));
console.log(sourceFile.text);
};
require('./node_modules/@angular/cli/bin/ng');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment