Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Webpack is awful
But bundling itself isn't only used in enterprise, you at least need it when installing npm dependencies rather than having global scripts -
I have no clue about JavaScript but I can imagine it could reduce code size quite a bit by doing dead code analysis on the entire bundle. Essentially LTO for silicon valley hipsters
-
Inxentas7902y@devRancid At my company I am the only dev. I have to decide what tools to use. If I am not touching NMP because I don't know how to use it properly anyway, can I forget about webpack?
-
Also for Vue it's a better development experience since u can write single file components, get autocomplete, hot reloading etc
And btw there are preconfigured bundlers, no need to create ur own config -
@vintprox I'd add that submodules, libraries and NPM packages which are expected to be processed by a usercode bundler as well benefit more from the minimalistic nature of plain Rollup whereas production bundles benefit more from Vite which does everything you'd expect from a bundler by default.
-
Webpack was among the first of its kind, and it pushed boundaries both in the elegance and quantity of configuration required for a basic setup, but you shouldn't use it directly today. Its biggest advantage over alternatives like Rollup is in metaframeworks such as Next where user config can be combined with framework config and the result only blows up about twice a month and at major releases of the metaframework.
-
Webpack is fucking awesome if you are working on a web app. So many cool features and so many cool plugins that people have made for it. It takes a long time to learn though, but lots of tutorials on the web for it. If you are building simple shit, use esbuild or something like that.
-
Webpack is slow af and a pain to configure
Pretty much all other bundlers I tried were better -
@phat-lasagna I don't like how it delegates all decisions exclusively to the user. For example, why should I have to specify that the Typescript plugin parses ts and tsx files? This stuff can and therefore should be sourced from the plugin itself if available, and I should only have to specify it if I want something different.
-
@lorentz I’m guessing it means to be exhaustive because of future maintenance + added configuration + updates
-
@phat-lasagna I'm not concerned about Typescript adding supported filetypes in the future breaking my build, and if I were, I just wouldn't update Typescript since NPM already uses an explicit individual dependency update policy.
I'm learning how to bundle with webpack. Cool. Exept that I don't have a single project in my portfolio that would benefit from any of it's features. Is this another "enterprise only" thing I can easily ignore in favor for the few <script> tags I'd normally use to hook up VUE or whatever?
rant