You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, thanks for putting together this simple yet powerful package. It is helping us migrate from commonjs to esm in our huge monorepo.
While using it, I noticed the fix for imports from barrel files is ignored, even if the barrel file itself is correctly resolved.
You can see in the following example:
Would you happen to know if the original behavior is the intended one? If so, why did you choose explicitly not to support barrel files?
I can open a PR if you want to support this specific use case.
The text was updated successfully, but these errors were encountered:
You suggestion works, I didn't think of determining the to value by checking the importName + "/index". This can prevent it from adding "/index.js" instead of ".js" when import name is already ending with "/index".
This patch is released in fix-esm-import-path@1.8.0 🚀
Please feel free to re-open the issue if the issue is not resolved
Hey, thanks for putting together this simple yet powerful package. It is helping us migrate from commonjs to esm in our huge monorepo.
While using it, I noticed the fix for imports from barrel files is ignored, even if the barrel file itself is correctly resolved.
You can see in the following example:
This happens specifically due to this line: https://github.com/beenotung/fix-esm-import-path/blob/master/fix-esm-import-path.js#L150
Removing it and changing the below code from:
to
fixed the issue.
Would you happen to know if the original behavior is the intended one? If so, why did you choose explicitly not to support barrel files?
I can open a PR if you want to support this specific use case.
The text was updated successfully, but these errors were encountered: