如何使用 angular yeoman 生成器在具有路径规范的 Laravel 项目中创建特定文件?

How do I use the angular yeoman generator to create specific files in a Laravel project with path specification?

我目前无法在使用 yeoman angular 生成器时指定路径。

当我执行 yo angular:service ServiceName 时,它会创建测试和脚本目录。

但我只想指定一个路径并告诉生成器我的 1 服务文件应该保存在哪里。

谁有过类似的经历,也许能指导我更好?

是的,我们可以。只需将其放在项目的根目录中并将其另存为 .yo-rc.json

{
  "generator-angular-fullstack": {
    "insertRoutes": true,
    "registerRoutesFile": "server/routes.js",
    "routesNeedle": "// Insert routes below",
    "routesBase": "/api/",
    "pluralizeRoutes": true,
    "insertSockets": true,
    "registerSocketsFile": "server/config/socketio.js",
    "socketsNeedle": "// Insert sockets below",
    "filters": {
      "babel": true,
      "js": true,
      "html": true,
      "sass": true,
      "uirouter": true,
      "bootstrap": true,
      "uibootstrap": true,
      "socketio": true,
      "mongoose": true,
      "auth": true
    }
  },
  "generator-ng-component": {
    "routeDirectory": "client/app/",
    "directiveDirectory": "client/app/",
    "filterDirectory": "client/app/",
    "serviceDirectory": "client/app/",
    "basePath": "client",
    "moduleName": "",
    "filters": [
      "uirouter"
    ],
    "extensions": [
      "babel",
      "js",
      "html",
      "scss"
    ],
    "directiveSimpleTemplates": "",
    "directiveComplexTemplates": "",
    "filterTemplates": "",
    "serviceTemplates": "",
    "factoryTemplates": "",
    "controllerTemplates": "",
    "decoratorTemplates": "",
    "providerTemplates": "",
    "routeTemplates": ""
  }
}