Skip to content

Webpack Benefits #2391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dolanmiu opened this issue Sep 28, 2016 · 9 comments
Closed

Webpack Benefits #2391

dolanmiu opened this issue Sep 28, 2016 · 9 comments

Comments

@dolanmiu
Copy link

Webpack update

We changed the build system between beta.10 and beta.14, from SystemJS to Webpack. And with it comes a lot of benefits. To take advantage of these, your app built with the old beta will need to migrate.

You can update your beta.10 projects to beta.14 by following these instructions.

Could someone elaborate on the benefits from switching from SystemJS to Webpack? The only benefit I can see so far is automatic detection and transpiling of .css and .scss files, which is cool.

P.S. What about JSPM?

@TheLarkInn
Copy link
Member

TheLarkInn commented Sep 28, 2016

There are a lot of behind the scenes features that webpack brings to the table out of the box, that SystemJS + SystemBundler did not.

It's really important to keep in mind the following:

webpack: module bundler (static build tool)
SystemJS: module loader (dynamic module loading in the run time)
SystemBundler: (the static build tool companion to SystemJS)

So the two aren't really the same thing, and serve different purposes (maybe in the future we [the webpack core team] will chose to have a stronger interop story between the two])

@manuelcua
Copy link

The highest benefit I can think of as of personal opinion is that you don´t have to keep track of what packages to add or remove in SystemJS, this is all done automatic because webpack uses the package.json information.

You also have a lot of control over the way your application will be built, but most of that customization is simplified with angular-cli.

@Auxx
Copy link

Auxx commented Sep 28, 2016

because webpack uses the package.json information

No, it does not use package.json information. Webpack analyzes your JS code and searches for imports, then it bundles everything. Webpack 2 is also doing a tree shake, meaning it searches for classes and functions which are not used in your application in any way and removes them from bundle.

@manuelcua
Copy link

@Auxx : Thank you for clarify that, when I changed to Webpack in my App I was sure I read somewhere that it was like that, but either way Webpack takes the burden off from managing those packages on my App.

@dolanmiu
Copy link
Author

dolanmiu commented Sep 28, 2016

I see, that makes sense

I have read somewhere that angular-cli decided to change to Webpack because SystemJS is still very new in its infancy and therefore not reliable. Is this true?

Source:

https://www.reddit.com/r/Angular2/comments/4lbdys/webpack_vs_systemjs_pros_cons/

@bonnici
Copy link

bonnici commented Sep 28, 2016

As someone who is working on an old pre-webpack project, one of the main advantages of webpack is that it makes installing 3rd party libraries a whole lot easier.

@dolanmiu
Copy link
Author

Seems the Angular team might end up with using Webpack 2 instead of broccoli as a lot of people in the community are in favour of it. They have already introduced a new module called compiler-cli for offline compilation. Think it does some tree shaking too but it isn't quite stable as of RC3.

Perhaps the main reason is that the community wants Webpack, so Angular2 delivers Webpack?

Source: https://www.reddit.com/r/Angular2/comments/4lbdys/webpack_vs_systemjs_pros_cons/

@filipesilva
Copy link
Contributor

Most of the discussion around this topic is found on #909.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants