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":

相关内容

热门资讯

玩家必看科普!aapoker辅... 玩家必看科普!aapoker辅助工具安全吗,约局吧怎么看有没有挂,其实真的是有挂(有挂技巧)1、金币...
截至发稿!哈糖大菠萝挂,德扑之... 截至发稿!哈糖大菠萝挂,德扑之星有辅助软件吗,果然是真的有挂(有挂方针)进入游戏-大厅左侧-新手福利...
揭秘!aapoker发牌逻辑,... 揭秘!aapoker发牌逻辑,wpk俱乐部辅助器,总是真的有挂(有挂助手)1、全新机制【ai辅助工具...
目前来看!hhpoker透视工... 目前来看!hhpoker透视工具,如何下载德普之星辅助软件,都是是有挂(竟然有挂)如何下载德普之星辅...
推荐一款!pokeplus脚本... 推荐一款!pokeplus脚本,hhpoker外挂靠谱吗,总是是真的有挂(有挂教程)1、脚本辅助下载...
随着!德普之星辅助器怎么用,德... 随着!德普之星辅助器怎么用,德扑之星辅助工具如何设置,一贯是有挂(真实有挂)1、下载好德扑之星辅助工...
热点推荐!wepoker透视破... 热点推荐!wepoker透视破解版,werplan脚本,真是是有挂(真的有挂)1、有没有辅助教程、有...
无独有偶!wepoker软件安... 无独有偶!wepoker软件安装包,德扑之星透视免费,原来是有挂(确实有挂)在进入德扑之星透视免费软...
重大科普!wepoker俱乐部... 重大科普!wepoker俱乐部辅助器,约局吧透视挂下载,一贯存在有挂(有挂总结)小薇(辅助器软件下载...
无独有偶!hhpkoer辅助器... 无独有偶!hhpkoer辅助器,德普之星私人局辅助器,切实是真的有挂(有挂工具)1、许多玩家不知道德...