-1

Sorry if this is stupid question. Just doing some Angular dev in my own time. Got VS code and wrote a very basic app, which is working ok. Looking at the folder structure I can't see any .js files in there. I thought the Angular compiler took .ts files and generated .js for the browser. If I run ng build I can see a dist folder created with the .js files in there. I'm not sure how Angular makes the app work in a browser without the .js files. Apologies again if this is a dumb question.

I can see them in the dev tools I just don't understand the transformation process.

enter image description here

  • Why do you feel like the `.js` files in `dist` are not what you're looking for? – possum Dec 30 '22 at 14:26
  • When compiled, it does use .js files inside the dist folder, why do you mean by "without the js files?" – Alejandro Barone Dec 30 '22 at 14:37
  • The dist folder in my solution only got created after I eventually did ng build but the app worked in the browser prior to me doing this. I guess what I'm trying to ask is although I can see the files .js in the dev tools of Chrome, where were they coming from prior to there being a dist folder in my solution? – user3742300 Dec 30 '22 at 15:39

1 Answers1

0

I think this explains it: What happens when you run ng serve?

The CLI supports running a live browser reload experience to users by running ng serve. This will compile the application upon file saves and reload the browser with the newly compiled application. This is done by hosting the application in memory and serving it via webpack-dev-server.