0

Can i bundle JS files with angular2 the same way i'm bundling HTML files?

I currently declare my JS files and copy them manually with the dist folder to my testing server.

is there a way so that i can make angular2 bundle those JS files with it when it webpacks?

Peter
  • 10,492
  • 21
  • 82
  • 132
Newbie
  • 386
  • 4
  • 19

1 Answers1

0

You can use AOT(Ahead-Of-time) compilation approach that provides you with ability to bundle all the exported classes that are imported somewhere in a single bundle.js. You can read the documentation here: https://angular.io/docs/ts/latest/cookbook/aot-compiler.html and follow all the steps mentioned. Its easy.

Otherwise you can use angular cli that does it automatically. Prefer this as this is the way ahead. Read the documentation here: https://cli.angular.io/

Peter
  • 10,492
  • 21
  • 82
  • 132