-2

I am making web app from zero based on Node.JS (Express, etc...) and I used to use the import/export in client side lately (Transcripted by Babel).

How bad idea is to somehow setup Babel to transcript even server side files and use import/export normally. I see Node v11 have import/export as experimental feature so it will be released soon.

I want to make this project from scratch to cleanup my old boilerplate and make it easy to use and clean as much as I can.

I thought this could be optimal. After import/export will be released in Node I will just turn Babel off and I dont need to change code.

Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
Baterka
  • 3,075
  • 5
  • 31
  • 60
  • Possible duplicate of [How can I use an es6 import in node?](https://stackoverflow.com/questions/45854169/how-can-i-use-an-es6-import-in-node) – Jared Smith Feb 20 '19 at 22:09

1 Answers1

0

There certainly is nothing wrong with using Babel with Node, especially if you've gotten used to using import syntax client side. You should use the preset-env to manage all the transformations necessary based on your environment.