Starting feel that webpack being too good at bundling stuff hides a lot of problematic practices. E.g. a library ships ESM build, but imports a CJS build of lodash - it works in webpack but... people just shouldn't do that :/
And because many libraries assumes to only be bundled with webpack, they are difficult to be made work with ESM-first bundlers. Sometimes they don't even know they are using dependencies that are not ESM-compatible - it only worked because webpack handled it.
I think webpack should introduce a "strict web mode" where it reports dependencies that are not ESM compatible or implicitly relying on Node built-ins - and encourage users to open issue in those libraries and nudge the authors to publish proper ESM builds.
You can follow @youyuxi.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: