如何在yeoman中更改生成器角度的生成文件的路径 [英] How do I change the path for generated files for the generator-angular in yeoman

查看:96
本文介绍了如何在yeoman中更改生成器角度的生成文件的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

摘录自 https://github.com/yeoman/generator-angular

yo angular:controller user

产生

app/scripts/controllers/user.js

我如何使其产生

app/js/controllers/user.js

我不认为我可以配置路径,因为源表明该路径很难编码:

I don't think I can configure the path since the source shows that the path is hard codded:

Generator.prototype.createControllerFiles = function createControllerFiles() {
  this.appTemplate('controller', 'scripts/controllers/' + this.name);
  this.testTemplate('spec/controller', 'controllers/' + this.name);
  this.addScriptToIndex('controllers/' + this.name);
};

https://github.com/yeoman/generator-angular/blob/master/controller/index.js#L22

我已经考虑过分叉项目并更改代码,但这感觉很脏. 我希望有一个可以更改的配置,但是没有github Wiki,所以我无法完全通过RTM来找到配置选项.我尝试查看 https://github.com/yeoman/generator -angular/blob/master/script-base.js ,但这也不是很有帮助.

I've considered forking the project and changing the code, but that feels dirty. I'm hoping that there is a configuration i can change, but there is no github wiki, so I can't exactly RTM to find the configuration options. I tried looking in https://github.com/yeoman/generator-angular/blob/master/script-base.js but that wasn't very helpful either.

推荐答案

很遗憾,目前尚无此修复程序.

Unfortunately there is no fix for this right now.

但是,好消息是该团队正在为此寻求解决方案.请参见此Twitter对话.

But the good news is that the team is working on a solution for this. See this Twitter conversation.

这篇关于如何在yeoman中更改生成器角度的生成文件的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆