How to generate .angular-cli.json file in Angular Cli?

前端 未结 9 2261
情深已故
情深已故 2020-12-04 23:57

I have installed Angular CLI package separately using npm:

npm install --save-dev @angular/cli@latest

When I try to use commands cli<

9条回答
  •  没有蜡笔的小新
    2020-12-05 00:22

    As far as I know Angular-cli file can't be created via a command like Package-lock file, If you want to create it, you have to do it manually.

    1. You can type ng new to create a new angular project

    2. Locate its .angular-cli.json file

    3. Copy all its content

    4. Create a folder in your original project, and name it .angular-cli.json

    5. Paste what copied from new project in newly created angular cli file of original project.

    6. Locate this line in angular cli file you created, and change the name field to original project's name. You can find the project name in package.json file

    project": {
      "name": ""
    },
    

    However, in newer angular version now it uses angular.json instead of angular-cli.json.

提交回复
热议问题