reload icon indicating copy to clipboard operation
reload copied to clipboard

Add ESM support

Open ahmadbilaldev opened this issue 4 years ago • 1 comments

Change the module from CommonJS to ECMAScript Module (ESM). Some JS Frameworks support ESM now and importing CommonJS modules may get complicated. Given that Node.js 12 has become a MAINTENANCE LTS, ECMAScript modules are the official standard format to package JavaScript code for reuse. Converting to ESM is recommended because ESM can still import CommonJS packages, but CommonJS packages cannot import ESM packages synchronously.

Two possible solutions are:

  1. Completely move to JavaScript ES Modules.
  2. Introduce a build step that transpiles a CommonJS fallback.

I can send in a PR if you agree.

ahmadbilaldev avatar Jun 22 '21 06:06 ahmadbilaldev

Yeah we are overdue at looking at this. Going to leave it open we should work on this soon.

@kethinov/@lannonbr would love your opinions on what we should do

alallier avatar Nov 26 '21 21:11 alallier