【问题标题】:Modifying Yeoman Angular generator to use folder other than app修改 Yeoman Angular 生成器以使用 app 以外的文件夹
【发布时间】:2013-12-05 13:20:20
【问题描述】:

我有一个现有项目,其目录结构类似于 public/angular/ 。但是在角度生成器中,一切都转到 app 。如何修改该行为并对其进行自定义? .对于初学者,我只是想将 app 文件夹更改为 public/angular/

我首先尝试通过更改

 this.env.options.appPath = 'public/angular';

但这导致一些文件进入 public/angular 并进入 app/ 的异常行为。目前 bower_components 和 views 和其他(404.html 和 favicon.ico)卡在 app/rest 在 public/angular

【问题讨论】:

    标签: angularjs yeoman yeoman-generator


    【解决方案1】:

    对于当前版本的 bower&yo,这需要在以下位置进行更改:

    • .bowerrc: "directory": "app/bower_components""directory": "public/angular/bower_components"
    • .gitignore: app/bower_componentspublic/angular/bower_components
    • bower.json:添加属性:"appPath": "public/angular" (https://github.com/yeoman/generator-angular#output)
    • karma.conf.js: 所有apppublic/angular

    如果您是从头开始,请在调用$ yo angular 后将app 文件夹移动到public/angular

    【讨论】:

    • @XMLilley:毕竟子弹 #3 可以通过 5 分钟的谷歌搜索推断出来 :)
    猜你喜欢
    • 1970-01-01
    • 2015-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-22
    • 1970-01-01
    相关资源
    最近更新 更多