官术网_书友最值得收藏!

 The package.json file 

The package.json file is very common in web applications that use Node.js modules. It is often found in frontend applications nowadays, in addition to server-side applications with Node.js. With the Angular framework, it is not different; this is one of the great advantages of the new version of Angular, since we can only import modules that are extremely necessary for the application, reducing the size and build time. Let's look at the contents of the package.json file. We added some comments before each important section:

{
"name": "chapter03",
"version": "0.0.0",
"license": "MIT",
// Npm commands, based on Angular/Cli commands, including: test and build.
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
// Dependencies to work in production, including:
@angular/core, @angular/common, @angular/route and many more.
"dependencies":{
...
},
// Dependencies only in development environment, including modules for test, TypeScript version, Angular/Cli installed locally and others.
"devDependencies": {
...
}
}

This file is automatically changed when we install a new module. And, we often add some commands inside the tag scripts, as you will see in the next chapters. You can read more about the package.json file in the official npm documentation at https://docs.npmjs.com/files/package.json.

主站蜘蛛池模板: 繁峙县| 上林县| 大埔县| 贵阳市| 揭阳市| 讷河市| 吉木萨尔县| 财经| 温州市| 苗栗市| 攀枝花市| 商河县| 左云县| 襄樊市| 嘉峪关市| 洛宁县| 简阳市| 乐东| 顺义区| 济宁市| 乐都县| 互助| 东海县| 武威市| 北京市| 东丽区| 奎屯市| 宁波市| 西青区| 涿州市| 布尔津县| 镇康县| 驻马店市| 潞西市| 耒阳市| 南康市| 明溪县| 东光县| 扎鲁特旗| 崇文区| 惠来县|