Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Babel 6 doesn't support JSX (or really, anything) by default; you need a plugin. The es2015 preset is what's in ES2015.


Then it's worthless to say "Babel is spec compliant" when it is just compiler infrastructure and not a compiler. It can be as spec compliant (or not) as you want.


babel-preset-es2015 is as canonical a "default configuration" as you're likely to find.


Does it enforce you putting `.js` on import strings? It should.


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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: