0

In my Angular2 application (ES6 spec), I am using WebPack with a common config which is extended in dev and prod config. In my prod config, I would like to also use uglification after doing tree shaking.

How do I make it happen? Any sample/link to configure this would be great help.

Would UglifyJsPlugin work with ES6 script? Would it need ES6-Shim?

Is it necessary to use Rollup for tree shaking? Should I completely shift to RollUp for the same?

Sorry, for a loaded question. Many thanks in advance!

Abhi
  • 1,624
  • 2
  • 16
  • 29

1 Answers1

0

I would suggest you start your project with angular-cli. It has all the scaffolding prepared, tested and working.

You can simply start a development server with ng serve and build artifacts with ng build. It includes AOT, tree-shaking, minification, etc.

Refer to the official documentation for more information.

Vladimir Zdenek
  • 2,270
  • 1
  • 18
  • 23
  • Thanks, Vladimir! I would love to do that but, unfortunately, that not an option. All i have to do now is make this work. :( – Abhi Jun 21 '17 at 15:28