建構 Angular 應用程式與更多資源
這篇文章內容涵蓋,如何建立一個生產版本(production)的應用程式,以及提供後續的學習資源。
預備知識: | 熟悉 HTML、CSS 和 JavaScript 的主要概念,以及 終端機/命令列 (en-US) 的知識。 |
---|---|
學習目標: | 學會如何編譯你的 Angular 應用程式 |
建置最終版的應用程式
現在你已經完成開發你的應用程式,接著執行 Angular CLI build
的指令。
當你在 todo
的目錄底下執行 build
的指令,應用程式會編譯並且輸出到 dist/
的目錄下。
在 todo
目錄底下,且在命令列執行以下的命令:
ng build -c production
命令列介面——CLI(Command Line Interface),會將應用程式編譯並且輸出到新的目錄 dist
底下。這個 --configuration production
/-c production
尾隨在 ng build
的參數,會移除在正式產品版本上不需要的東西。
部署你的應用程式
為了部署你的應用程式,你可以複製 dist/my-project-name
資料夾底下的內容到你的伺服器上。
因為這些都是靜態檔案,你可以將這些檔案放到任何能夠提供檔案的伺服器上,像是:
你可以使用任何後端,像是 Firebase、Google Cloud 或 App Engine。
接著要做什麼
總結
在這個模組中
- Introduction to client-side frameworks
- Framework main features (en-US)
- React
- Ember
- Vue
- Getting started with Vue
- Creating our first Vue component
- Rendering a list of Vue components (en-US)
- Adding a new todo form: Vue events, methods, and models (en-US)
- Styling Vue components with CSS (en-US)
- Using Vue computed properties (en-US)
- Vue conditional rendering: editing existing todos (en-US)
- Focus management with Vue refs (en-US)
- Vue resources (en-US)
- Svelte
- Getting started with Svelte
- Starting our Svelte Todo list app
- Dynamic behavior in Svelte: working with variables and props
- Componentizing our Svelte app (en-US)
- Advanced Svelte: Reactivity, lifecycle, accessibility (en-US)
- Working with Svelte stores (en-US)
- TypeScript support in Svelte (en-US)
- Deployment and next steps (en-US)
- Angular