角度示意图有一些tasks。 我想创建自己的任务以与脚本执行器一起运行。 An example of how angular does this。
此刻,我刚刚在原理图的末尾生成了预定义的任务。
答案 0 :(得分:0)
我能够注册执行程序,但不支持,因为我使用的是私有字段。这是您需要做的:
const host = <NodeModulesEngineHost>(<any>context.engine)._host; // this line is not supported
host.registerTaskExecutor<YourFactoryOptions>({
name: "your-executor-name",
create: (opt) => import('../path/to/executor').then(mod => mod.default(opt))
});
您可以see on Github如何创建任务执行者注册,然后实际上是registered here。