Return to site

ANGULAR: The Config Files ⚙️

· ngInterview,fullstack

𝐦𝐚𝐢𝐧.𝐭𝐬 🚀

  • 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.