Return to site

ANGULAR: The Config Files โš™๏ธ

July 2, 2022

๐ฆ๐š๐ข๐ง.๐ญ๐ฌ ๐Ÿš€

  • The main.ts file is the main file which is the start point of our application.
  • As you have read before about the main method the same concepts are here in the Angular application.
  • It's the file for the bootstrapping the application by the main module as .bootstrapModule (AppModule).
  • It means according to main.ts file, Angular loads this module first.

๐ฉ๐š๐œ๐ค๐š๐ ๐ž.๐ฃ๐ฌ๐จ๐ง โ€ผ๏ธ

  • Itโ€™s the most important file for the Angular application.
  • There are many settings in this file including dependencies and devDependencies.
  • When we run npm install, Angular installs all the dependencies as defined in this file.

๐ฉ๐š๐œ๐ค๐š๐ ๐ž-๐ฅ๐จ๐œ๐ค.๐ฃ๐ฌ๐จ๐ง ๐Ÿ’พ

  • Whenever npm modifies the node_module tree or package.json file, then package-lock.json is automatically generated.
  1. โœ“ This file is intended to be committed into source repositories, and serves various purposes:
  2. โœ“ Describe a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies.
  3. โœ“ Provide a facility for users to "time-travel" to previous states of node_modules without having to commit the directory itself.
  4. โœ“ To facilitate greater visibility of tree changes through readable source control diffs.
  5. โœ“ And optimize the installation process by allowing npm to skip repeated metadata resolutions for previously-installed packages.

๐ญ๐ฌ๐œ๐จ๐ง๐Ÿ๐ข๐ .๐ฃ๐ฌ๐จ๐ง โš™๏ธ

  • The tsconfig.json is the configuration file and there are many setting for TypeScript compiler.
  • According to these settings the TypeScript code to compile into Javascript so that browser can understand it .

๐š๐ง๐ ๐ฎ๐ฅ๐š๐ซ-๐œ๐ฅ๐ข.๐ฃ๐ฌ๐จ๐ง ๐Ÿ”ง

  • The Angular-cli.json is the configuration file of Angular application in which we have many configuration settings which is required for Angular application.

๐š๐ฌ๐ฌ๐ž๐ญ ๐Ÿ๐จ๐ฅ๐๐ž๐ซ ๐Ÿ–ผ๏ธ

  • Whenever we build our Angular application with "npm run build" or "ng build --prod" commands,
  • then Angular CLI moved all of our assets into the dist folder.
  • It will do the same when it sees that there are images inside the assets folder.
  • So, we can say that assets folder is used in Angular for maintaining the Angular assets as image etc which doesn't have to be modified while compiling.