Building our application
Now is the time to deploy our application, but before we do this, we need to compress and minify our Aurelia code. Aurelia CLI provides us with the build option to generate these ready-to-deploy files that contain all our application code.
As you might want to build your application for different environments (dev, stage, or prod), this build option comes along with the --env flag. For example, execute the following command in your project:
au build --env prod
The following is a sample output of my-app project:
As the output shows, there are two main files generated: app-bundle.js, which contains our application logic and vendor-bundle.js, which contains third-party dependencies. These two files are generated into the scripts folder in our root application folder.
If you want to run your application and check whether everything is okay with the bundles you recently created, let's install the http-server module using npm. Run the following command in your Terminal:
npm install -g http-server
Now, create a dist folder in your application root folder and copy the index.html page and the scripts folder that contain our bundles.
For the last step, get into the dist folder in your Terminal and run the following command:
cd dist
http-server
Use the cd command to navigate across your folders in your Terminal.
This command will expose some four URLs where the web server is running; copy the first URL and open it on your web browser, and you should see your application up and running:
- CorelDRAW X6 中文版圖形設(shè)計實戰(zhàn)從入門到精通
- 物聯(lián)網(wǎng)安全(原書第2版)
- Building E-commerce Sites with VirtueMart Cookbook
- Truffle Quick Start Guide
- 電子政務(wù)效益的經(jīng)濟(jì)分析與評價
- OpenLayers Cookbook
- 計算機(jī)網(wǎng)絡(luò)與數(shù)據(jù)通信
- 智慧光網(wǎng)絡(luò):關(guān)鍵技術(shù)、應(yīng)用實踐和未來演進(jìn)
- 網(wǎng)管員必讀:網(wǎng)絡(luò)管理(第2版)
- 基于性能的保障理論與方法
- Bonita Open Solution 5.x Essentials
- 互聯(lián)網(wǎng)+思維與創(chuàng)新:通往未來的+號
- Getting Started with Memcached
- 人際網(wǎng)絡(luò)
- 小型局域網(wǎng)組建