Angular项目中的angular.json和package.json的区别是什么?
创始人
2024-10-30 04:30:34
0

在Angular项目中,angular.json和package.json都是重要的配置文件。其中,angular.json是Angular CLI项目的配置文件,而package.json是node.js的包管理器npm所用的文件。下面是它们的区别:

  1. angular.json用于配置Angular CLI的项目,其中包括项目的结构、构建选项、依赖关系等。而package.json主要用于管理node.js的依赖项和脚本。

  2. angular.json是Angular CLI的配置文件,所以更改它需要重新运行ng serve。而package.json的更改则会自动更新依赖项。

  3. angular.json在项目根目录中,而package.json在项目的根目录或src目录中。

以下是示例代码:

// angular.json { "projects": { "my-app": { "root": "", "sourceRoot": "src", "projectType": "application", "prefix": "app", "schematics": { "@schematics/angular:component": { "styleext": "scss" } }, "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist/my-app", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.app.json", "aot": true, "assets": [ "src/favicon.ico", "src/assets" ], "styles": [ "src/styles.scss" ], "scripts": [] }, "configurations": { "production": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "optimization": true, "outputHashing": "all", "sourceMap": false, "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "browserTarget": "my-app:build" } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options":

相关内容

热门资讯

透视线上!pokemmo手机版... 透视线上!pokemmo手机版修改器(透视)原来是真的有挂(详细辅助软件教程)1、ai机器人多个强度...
科技新动态!we poker免... 科技新动态!we poker免费辅助器,wpk作弊最怕三个东西,透明教程(有挂方法)这是由厦门游乐互...
透视攻略!wepoker透视有... 透视攻略!wepoker透视有没有(透视)总是是真的有挂(详细辅助必胜教程);在进入wepoker透...
最新技巧!aapoker透视插... 最新技巧!aapoker透视插件,德州机器人代打脚本,教你攻略(有挂透明);大神普及一款德州ai内幕...
透视好友房!wepoker俱乐... 透视好友房!wepoker俱乐部辅助(透视)原来是真的有挂(详细辅助攻略方法);1、玩家可以在软件透...
如何分辨真伪!竞技联盟辅助,h... 如何分辨真伪!竞技联盟辅助,hhpoker辅助器,切实教程(有挂方法);亲真的是有正版授权,小编(透...
透视黑科技!来玩app破解(透... 透视黑科技!来玩app破解(透视)果然真的有挂(详细辅助插件教程)在进入辅助挂后,参与本局比赛的八名...
我来向大家传授!德州私人局怎么... 我来向大家传授!德州私人局怎么透视,pokemmo手机脚本,线上教程(有挂辅助);亲真的是有正版授权...
透视模拟器!wepoker辅助... 透视模拟器!wepoker辅助器免费(透视)总是真的是有挂(详细辅助必备教程)亲,关键说明,赛季回归...
重大发现!pokermaste... 重大发现!pokermaster破解版,wepoker有什么规律,黑科技教程(有挂攻略);wepok...