Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ES6 default export #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

webfrank
Copy link

Added ES6 export, can be used like:

import renderjson from 'renderjson

@andifreed
Copy link

Does that break ES5 support?

@rtritto
Copy link

rtritto commented Sep 28, 2022

Any update?

@rtritto
Copy link

rtritto commented Feb 24, 2023

@caldwell please can you merge this?

@caldwell
Copy link
Owner

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…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants