nikjohn
nikjohn

Reputation: 21918

Is Babel transpiling required for Node v6?

Considering that Node v6.x comes with ~93% coverage of the ES2015 spec, is Babel transpiling required anymore?

I am creating a web application with Node v6 and Express. If this were merely a Node app, I wouldn't have thought about Babel, but considering that there is going to be some client side JS as well, I'm thinking I should have the static JS files transpiled. Is this a correct assumption?

If required, what would an example .babelrc be?

Currently, I'm thinking:

{
"presets": [
  "node6",
  "es2015"
 ]
}

Upvotes: 1

Views: 462

Answers (1)

Brad
Brad

Reputation: 163612

Your server-side code and your client-side code have nothing to do with each other. The fact that you run Node.js v6 on the server has no bearing on what will be running your code in a browser.

If you want to use ES6 features with broad browser coverage, you need a transpiler for the client-side code.

Upvotes: 6

Related Questions