我找不到如何通过ng g workspace-schematic <schematic-name>将新创建的schematics与NX一起使用
这是我的结构:
|- tools/
|- schematics
|- my-first-schematic
|- my-second-schematic我想在my-second-schematic中使用my-first-schematic。我知道externalSchematic(),但是当我们想要从另一个集合中调用schematif时,它很有用。
谢谢!
发布于 2019-10-02 06:25:59
我们可以直接将my-first-schematic导入my-second-schematic,然后简单地链接它。例如:
tools/schematics/my-first-schematics/index.ts
export default function(schema: any): Rule {
console.log('my-first-schematics');
}tools/schematics/my-second-schematic/index.ts
import myFirstSchematics from '../my-first-schematics';
export default function(schema: any): Rule {
console.log('my-second-schematic');
...
return chain([
myFirstSchematics(schema),
...
]);
}https://stackoverflow.com/questions/55531718
复制相似问题