代码之家  ›  专栏  ›  技术社区  ›  Ricardo Rocha

Angular6:如何从命令行[duplicate]生成默认的angular.json文件

  •  0
  • Ricardo Rocha  · 技术社区  · 6 年前

    我使用angular6创建了一个新模块,它将作为一个包在另一个项目中使用。

    现在,我正在尝试配置karma和jasmine,以便对其创建单元测试。问题是我发现这个项目没有 angular.json

    可以生成默认值 角度.json 命令行中的文件?

    1 回复  |  直到 6 年前
        1
  •  1
  •   kfrisbie    6 年前

    ng new project-name
    

    对“ng”命令行选项的快速检查不会显示任何单独生成新angular.json的选项:

     ng -h
    
    Available Commands:
      add Add support for a library to your project.
      new Creates a new directory and a new Angular app.
      generate Generates and/or modifies files based on a schematic.
      update Updates your application and its dependencies.
      build Builds your app and places it into the output path (dist/ by default).
      serve Builds and serves your app, rebuilding on file changes.
      test Run unit tests in existing project.
      e2e Run e2e tests in existing project.
      lint Lints code in existing project.
      xi18n Extracts i18n messages from source code.
      run Runs Architect targets.
      eject Temporarily disabled. Ejects your app and output the proper webpack configuration and scripts.
      config Get/set configuration values.
      help Help.
      version Outputs Angular CLI version.
      doc Opens the official Angular API documentation for a given keyword.
    

    您还可以基于 documentation Angular CLI project on Github .