Colum Ferry 6d9ec39c75
feat(angular): create routes file pattern (#11930)
add host remote correctly

library routes

fix tests
2022-09-28 15:54:53 +01:00

27 lines
718 B
TypeScript

import type { Tree } from '@nrwl/devkit';
import { generateFiles, joinPathFragments } from '@nrwl/devkit';
import { getRelativePathToRootTsConfig } from '@nrwl/workspace/src/utilities/typescript';
import type { NormalizedSchema } from './normalized-schema';
export function createFiles(tree: Tree, options: NormalizedSchema) {
generateFiles(
tree,
joinPathFragments(__dirname, '../files'),
options.appProjectRoot,
{
...options,
rootTsConfigPath: getRelativePathToRootTsConfig(
tree,
options.appProjectRoot
),
tpl: '',
}
);
if (!options.routing) {
tree.delete(
joinPathFragments(options.appProjectRoot, 'src/app/app.routes.ts')
);
}
}