我目前正在尝试创建自己的自定义 Angular Schematics。我有以下内容:
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
// You don't have to export the function as default. You can also have more than one rule factory
// per file.
export function pxSchematics(options: any): Rule {
return (tree: Tree, _context: SchematicContext) => {
tree.create(options.name || 'hello', 'world');
return tree;
};
}
它只是创建一个带有“hello world”的文件。我将如何更改树的文件路径,以便将文件输出到各种自定义目录中?谢谢你。