-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
support NodeJS ESM Module only project #285
Comments
As quick fix you can specify path to JS file with I agree that it will be nice to look for default path in |
Thanks. I take a quick look into the code, but couldn't identify where does it get the default path. :( btw, is there a I have a project that while small, it reports:
I'm not sure it is that small~ :) When I do
|
For ESM, you need to specify |
Turns out I don't have to. The package is that small. :) On the other hand, I'm getting these warnings from
These output files are used by CommonJS, where the package is configured as follows:
Is there a way to tell |
It should detects it automatically by |
It does, which is the problem here. because under As for
|
You need to explicitly add Otherwise, your npm package will not work in Node.js. |
TypeScript (including the latest 4.7) does not support that. |
Welcome to the hell of ESM migration :D. I can’t help with TS. |
🤣 no problem. ESM migration with TypeScript is hell x 2. Here are some links related to it if you are interested: microsoft/TypeScript#49083 |
ESM migration with TypeScript and Jest is hell^3. @unional, if understand correctly, it seems that's necessary to inject |
What I understand is to these two things:
I'm still not sure about changing the I think that's also part of the reason TypeScript team don't want to do it. |
We can use |
See https://github.com/sheremet-va/dual-packaging You need something like |
Currently, ESM Module only project doesn't work with
size-limit
, bothesbuild
andwebpack
plugin fails to recognize the project:They both try to look for
<proj>/index.js
becausemain
was not specified.The text was updated successfully, but these errors were encountered: