bka
bka

Reputation: 221

SystemJS vs Webpack for Angular 2 applications

We are starting a new Angular2 SPA and I am looking into whether to use SystemJS as described in the Angular Quickstart tutorial (https://angular.io/guide/quickstart) or Webpack (https://angular.io/docs/ts/latest/guide/webpack.html).

Researching this online, people appear to be moving from SystemJS to Webpack. For example, the "Angular CLI" project from Google: http://react-etc.net/entry/angular-2-cli-moves-from-systemjs-to-webpack

Webpack not only handle modules but also provides a way to package the application (concat files, minify/uglify files, ...). The new version also provides "tree shaking" (remove dead/unused modules from the final build).

With SystemJS, we would still need to use gulp (or something else) to build the app.

If you are starting with a new Angular 2 app, which one would you use?

Upvotes: 18

Views: 3948

Answers (1)

Alexander Ciesielski
Alexander Ciesielski

Reputation: 10834

I'm using angular-cli for 6 months now, and the change to webpack was the best decision they could make. It builds faster, is so much easier to work with than SystemJS (almost no configuration on my part), supports bundling, tree-shaking, lazy-loading and so much more.

The tool is getting better every month, I have 3 production apps right now.

You can't go wrong with angular-cli if you don't want to be bothered with losing time configuring SystemJS or any other bundler.

Upvotes: 12

Related Questions