renderjson icon indicating copy to clipboard operation
renderjson copied to clipboard

Fix ES6 default export

Open webfrank opened this issue 5 years ago • 4 comments

Added ES6 export, can be used like:

import renderjson from 'renderjson

webfrank avatar Mar 10 '21 15:03 webfrank

Does that break ES5 support?

andifreed avatar Mar 10 '21 18:03 andifreed

Any update?

rtritto avatar Sep 28 '22 23:09 rtritto

@caldwell please can you merge this?

rtritto avatar Feb 24 '23 01:02 rtritto

Not as it stands, no. When try it on the test.html page I get this error:

Uncaught SyntaxError: export declarations may only appear at top level of a module

I'm not opposed to Ecmascript modules at all, but right this second I don't know how to make something compatible with commonjs and modules and just raw <script> sourcing in html.

Probably the right answer in 2023 is to just make it a module, and use esbuild or something to make the non-module version/minimized versions when prepping for npm publish…

caldwell avatar Feb 27 '23 18:02 caldwell