Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (host: Tree) => {
const modulePath = `${path}/app/app.module.ts`;
const moduleSource = host.read(modulePath)!.toString('utf-8');
const sourceFile = ts.createSourceFile(modulePath, moduleSource, ts.ScriptTarget.Latest, true);
const importChanges = addImportToModule(sourceFile, modulePath, 'BrowserModule', '@angular/platform-browser');
const bootstrapChanges = addBootstrapToModule(sourceFile, modulePath, 'AppComponent', './app.component');
insert(host, modulePath, [...importChanges, ...bootstrapChanges]);
return host;
};
}