4 ms·
Try configuring your bundler so it outputs source maps, and disable js transformations aimed at compatibility with old browsers. Like whatever they do with for.
by jraph 4y ago
Try configuring your bundler so it outputs source maps, and disable js transformations aimed at compatibility with old browsers. Like whatever they do with for..of loops and async/await that makes the code unintelligible. For this, put whatever is needed in the configuration of the bundler to target the latest version of Chrome or Firefox (for instance [1] for babel / webpack).
It's worth it really.
And maybe in the future bundlers will not be needed anymore. On recent browsers with HTTP2 and gzip compression, I question the need of bundling at all, especially if the dependency tree is limited (yes, that's a HUGE if). With HTTP2 multiplexing / connections kept alive, Good old <script> tags might work quite well now (with type="module").
[1] https://webpack.js.org/loaders/babel-loader/#customize-config-based-on-webpack-target https://webpack.js.org/loaders/babel-loader/#customize-confi...