Hacker News new | ask | show | jobs
by tracker1 3692 days ago
Why would it.. babel doesn't do any actual import/export modification. It doesn't have a module/bundler built in... that's what webpack, browserify and the like are for.. and no, they don't require the .js, but you can still use it.
1 comments

Right, but the argument for being spec compliant is that some day you can simply stop using the transpiler and your code should not break.

So, the correct spec-compliant thing to do would be for the ES2015 preset not to touch import/export and let the bundler handle that (hopefully correct). Compiling to CommonJS, which doesn't care about `.js` or not, is the wrong choice.