fix(angular): update ng-add schematic

This commit is contained in:
Mike Hartington
2019-04-03 09:51:11 -04:00
parent 2ceacf9d50
commit 9443bfeca6
2 changed files with 29 additions and 15 deletions

View File

@@ -64,6 +64,18 @@ export function addStyle(host: Tree, stylePath: string) {
}
}
export function addAsset(host: Tree, asset: string | {glob: string; input: string; output: string}) {
const config = readConfig(host);
const appConfig = getAngularAppConfig(config);
if (appConfig) {
appConfig.architect.build.options.assets.push(asset);
writeConfig(host, config);
} else {
throw new SchematicsException(`Cannot find valid app`);
}
}
export function addArchitectBuilder(host: Tree, builderName: string, builderOpts: any){
const config = readConfig(host);
const appConfig = getAngularAppConfig(config);