0

I come from an Ext JS background, where we can run a build command and then create a war from the minimized source code.

Now I am finding it difficult to do such thing in Angular 2.

How can we minimize the Angular code & then create a WAR for deployment?

alex kucksdorf
  • 2,573
  • 1
  • 15
  • 26
Vishwajeet
  • 71
  • 1
  • 7

2 Answers2

0

Angular 2 comes with CLI commands which you need to use for building & serving your app in different runtime environments. For running it on your local dev machine you can use ng serve command.

For building and deploying to production environment you can use ng build --prod and then copy the contents from .dist directory on the server from where you wish to host your app.

Gurdev Singh
  • 1,996
  • 13
  • 11
0

Angular CLI as mentioned in the other answer uses what's called Ahead of Time compilation, which creates a single minified file for the whole Angular app. You can also do this without the CLI. See my earlier answer here:

How to bundle an Angular app for production

Peter Salomonsen
  • 5,525
  • 2
  • 24
  • 38