When using the Angular CLI, we have many moving parts. To really understand what is happening, we need to consider some of the main technologies used in the Angular CLI, as they relate to the output files and the module resolution:
- TypeScript - Converts your TypeScript code to ES5 or ES6 (most often ES5). Transformed code will use CommonJS modules by default if the target is ES5. If the target is ES6, then ES6 modules will be used.
- Webpack - take your passed TypeScript code and plot your import / export dependency based on the entry points defined in
webpack.config.js . This dependency graph will include all of your modules, and it will pack these modules in 1+ packages , depending on the configuration. This is the step where the @angular/core dependency (which is located in node_modules/@angular/core ) is processed by Webpack and added to the package, which can be accessed at runtime.
You can upload the generated packages to the page by including the generated files in your HTML. In the case of JS files, you upload them using a script tag, as you did with AngularJS.
Since we use the Angular CLI, by default there are many configurations in Webpack, so we will have several packages generated.
I just created an empty Angular CLI project and checked the HTML to see the 5 generated packages:

At the heart of the difficulty when comparing Angular project files with AngularJS files is that Angular code is converted using several build steps, and AngularJS code is usually used out of the box with ES5. If you want to add Webpack and TypeScript to your AngularJS assembly, you will see something very similar to Angular output.
Where is Webpack located in the Angular CLI?
Under the hood, the Angular CLI uses Webpack to create your project and merge your files.
The Angular team decided not to expose the Webpack configuration file for the Angular CLI, but they added a ng eject that generates webpack.config.js that matches the Webpack assembly of your project. The drawback of extracting is that you will no longer use ng serve to serve your project. Instead, you will use npm run build && npm run start (you'll see that these scripts are added to your package.json after extraction), which will create and maintain your project based on the generated webpack.config.js file.
This feature is very important if you need to make changes to the default Webpack assembly by default.
Read more about ng eject here .
Where are the generated packages?
If you use ng serve , you will not see any of your generated files, since they are served from memory and not from disk (to speed up when files are constantly changing), so your generated files are not located in any folder.
If you want to view the created files, you can run ng build , which will create a dist folder with index.html and its associated assets / packages.
Please note that by default, all the commands that build or maintain your project will delete your dist folder unless you pass --no-delete-output-path when creating / maintaining.