What does webpack do? from my very shallow understanding, it bundles asset files together such as css and js. Could i not do it myself without webpack? And how does it even optimise bundles? I see from some files the size decreases more than 50%
Asked
Active
Viewed 29 times
0
-
Possible duplicate of [NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack](https://stackoverflow.com/questions/35062852/npm-vs-bower-vs-browserify-vs-gulp-vs-grunt-vs-webpack) – madflow Sep 29 '19 at 14:02
-
https://stackoverflow.com/questions/35062852/npm-vs-bower-vs-browserify-vs-gulp-vs-grunt-vs-webpack – madflow Sep 29 '19 at 14:02
1 Answers
0
it bundles asset files together such as css and js.
Yes, and other resourse types as well.
Could i not do it myself without webpack?
You can but it's a lot of work. Why reinvent the wheel.
And how does it even optimise bundles?
Tree shaking (eliminating unused code), splitting assets into several bundles, bundle minification, bundle compression, giving unique (hash based) names to the bundles to make it caching-safe and generating .html files referencing these bundle names.

winwiz1
- 2,906
- 11
- 24
-
-
[webpack](https://github.com/webpack/webpack) itself is written in javascript and is used to build javascript and typescript projects. – winwiz1 Sep 28 '19 at 13:14