Why: Importmap vs Webpack
Why is importmap preferred over webpack?
DHH covers a lot of the move away from node tools like esbuild, rollup.js, and webpack in this blog post. Here are a few more notes on why I think the move was probably made.
A npm package is upgraded every couple of months and breaks webpack backward compatible with other libraries or old configuration schema settings. Speaking from real-world experience, it’s the wild west.
- I have seen schema or interfaces for configurations like
config/webpacker.ymlchange in breaking ways.
- Here are just some examples: webpacker 2059, webpacker 2202, webpacker 2342, jetpacker 4
- I have found it’s usually faster to treat things like a black box when there have been webpack issues. IE: Upgrade yarn, node, and regenerate the configuration files and see if that fixes issues. Sometimes have to dig deeper, and that takes a decent amount of time.
- Ultimately, there are only so many hours in a day.