DEV Community

Discussion on: How to use ES6 import syntax in Node.js

Collapse
 
ducaale profile image
Mohamed Dahir

I would like to point out that there are a couple of nuances when moving from babel-translated import syntax to native ES module imports:

  • You need to specify the extension for relative files
  • You cannot use require in your ES modules
  • You cannot use named imports to import from non-ES modules

I'd say it is a bit messy at the moment but it is the future and we have to embrace it. For more information, See

Collapse
 
amanhimself profile image
Aman Mittal

Thanks for sharing this. I'll take a look. :)