In a previews post we discussed what we can achieve without using js bundler. Let's see now, what benefits we can have by using one.
- having all js bundled together into one file - which gives us a better performance on production deployment.
- simpler imports of npm dependencies. The bundler-free approach works but feels a bit hacky and it's more hassle to maintain.
- build-in code optimization applied automatically by webpack
- it opens doors for many futures improvements - transpiling code so we can use new language features while supporting older browsers; including styles directly from the app or moving our code base to typescript.