我使用 Angular 6 创建一个新模块,它将作为一个包在另一个项目中使用。
现在,我正在尝试配置 karma 和 jasmine,以便我可以在其上创建单元测试。问题是我发现这个项目没有任何angular.json
file.
可以生成默认值angular.json
从命令行输入文件?
您最好的选择是按照 danday74 的建议进行操作并生成一个新项目并从该生成的项目中复制 angular.json 文件:
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.
您还可以根据以下内容手动创建自己的 angular.json文档 https://github.com/angular/angular-cli/wiki/angular-workspace由提供Github 上的 Angular CLI 项目 https://github.com/angular/angular-cli.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)