-
Notifications
You must be signed in to change notification settings - Fork 96
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
Feature request: add commonjs and esm exports #299
Comments
Ya, I feel like whoever made this change isn't living in reality. ESM-only simply doesn't work for any app of medium complexity. |
Did you guys find a workaround? @ericallam @Spudfellah |
@palfaro91 unfortunately the only way at the moment is to use dynamic imports. |
Going back to ^1.13.3 is a temporary solution |
That kinda works, but it doesn't work once you're using |
Also happy to submit a PR to support both ESM and CommonJS. |
Tried to use Edit: {
"version": "2.2.1",
"name": "superjson",
"license": "MIT",
"type": "commonjs",
"types": "./index.d.ts",
"main": "./index.cjs",
"browser": "./index.cjs",
"exports": {
".": {
"types": "./index.d.ts",
"browser": "./index.cjs",
"import": "./index.cjs",
"require": "./index.cjs",
"default": "./index.cjs"
}
},
"files": [
"*.js",
"*.cjs",
"*.d.ts"
]
} |
Currently superjson does not export commonjs, only ESM. It would be great to support both formats. Our package that we use superjson in supports both formats and having superjson be ESM only causes some issues. It's really easy these days to create a dual-package using something like tshy (which is what we use). If you are open to it, I'd be happy to create a PR.
The text was updated successfully, but these errors were encountered: