AI Hints
Home›Angular Tutorial›Building for Production, @defer and Deploying
Angular · Lesson 111 of 120

Deploying

Put it online.

⏱ 2 min read▶ Video at 2:13:05🎓 Free
Watch this lesson in the Angular courseWatch on YouTube ↗Full Angular course

A production build is just a folder of files. HTML, JavaScript, and CSS. To put the shop online, we upload that folder to a web host.

  • Just files
  • HTML, JS, CSS
  • Upload to a host

The build output

In the project, ng build creates the production files. Ls shows what's inside the browser folder. An index page, the main JavaScript file, the styles, and an icon. That folder is the whole app.

Terminal
cd shop
ng build
❯ Building...
✔ Building...
Initial chunk files | Names         |  Raw size | Estimated transfer size
main-QQCMYT6M.js    | main          | 218.05 kB |                59.78 kB
styles-5INURTSO.css | styles        |   0 bytes |                 0 bytes

                    | Initial total | 218.05 kB |                59.78 kB

Application bundle generation complete. [1.047 seconds] - 2026-11-25T22:44:02.823Z

Output location: /home/sam/shop/dist/shop
ls dist/shop/browser
favicon.ico
index.html
main-QQCMYT6M.js
styles-5INURTSO.css

Where to host it

Any host that serves static files will work. Firebase hosting, Netlify, Vercel, Cloudflare pages, and GitHub pages, all have free plans. You upload the browser folder, or connect your code repository.

HostHow
Firebase Hostingng add @angular/fire, then deploy
Netlify / Vercelconnect your repository
Cloudflare Pagesconnect, or upload the folder
Any web servercopy dist/shop/browser

One important setting

Our app has routes, like slash books slash three. But the server only has index dot html. So the host must send index dot html for every address, and let the router take over. Most hosts call this a single page app, or a rewrite rule.

keyvalue
/books/3no such file on the server
Fixserve index.html for every path
CalledSPA fallback / rewrite
Thenthe router takes over

Summary

Deploying means uploading the browser folder to a static host, with every address sent to index dot html. Next, the course project.

Key takeaways
  • dist/shop/browser
  • A static host
  • SPA fallback
Next up: Project: The Plan — putting it all together