Gene
  • Introduction
  • Folder Structure
  • Installation
  • Layouts
  • Translate App
  • Adding/Deleting Menu & Component
  • Adding Widgets in Component
  • Seed Project
  • Style Customization
  • RTL
  • Components
    • Chat
    • Calendar
    • Inbox
    • Editor
    • Material Icons
    • ng2 Chart
    • UI Component
    • Drag and Drop
    • Sortable js
    • Tables
      • Fullscreen
      • Selection
      • Pinning
      • Sorting
      • Paging
      • Editing
      • Filter
    • Forms
    • Maps
  • Deployment
  • Credits
  • Template Update
  • FAQ's (Frequently Asked Questions)
  • Changelog
  • Customer Support
    • Hire Us
Powered by GitBook
On this page
  • Simple Deployment
  • AOT
  • Further help
  • Build command for gene
  • Building for a Relative Path

Was this helpful?

Deployment

In this section you will learn about how to deploy your application on the live server. Please read the documentation carefully.

PreviousMapsNextCredits

Last updated 6 years ago

Was this helpful?

Simple Deployment

For the simple deployment, follow the steps given below:

Step 1: Make a production build, by running the command given below:

ng build --prod

It will create the dist folder, that contains the production build files.

Step 2: Now you just need to upload the dist files on to the server.

Step 3: Configure the server to redirect requests for missing files to index.html. Learn more about server-side redirects .

AOT

It is Ahead-of-Time (AOT) compiler, which compiles your app at build time. For AOT compilation, include the --aot option with the commands.

ng build --prod --aot

Further help

To get more help on the angular-cli use ng --help or for more details, please visit .

Build command for gene

We use the following command to build a production build. It will reduce the build size by optimizing the code at build time.

ng build --prod --aot --build-optimizer

Building for a Relative Path

If you want to make your production build in different folder or sub directory. Like, if you want that the template run on the test.com/output rather then test.com then you need to follow the steps given below:

Step 1: Open the src->index.html file & search for the base tag:

   <base href="/">

and set your path as per requirement like:

   <base href="/output/">

After that you need to create a new sub folder with the name output and upload all the files in this folder.

You need a .htaccess file to upload the build to server. Make sure you have included this file in your folder that you are going to upload on the server.

below
https://github.com/angular/angular-cli