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 nice package, but unfortunately not ESModule-compliant.
You use the import syntax in your documentation, and you even provide TypeScript types, which is a bit misleading because in the hood your script is CommonJS. That's bad practice.
I am having a hard time integrating your lib into my TypeScript project.
You may want to consider turning your script into an ES Module anyway. Modern browsers support modules now it's safe, that means your package wouldn't technically need any compilation, you could just load it into the browser in a module context.
But you still can use it in a compilation process, most transpilers and bundlers understand modules now.
Technically you wouldn't need much headache, just adding "type": "module" in your package.json and changing module.exports = ... to export default ... I guess.
The text was updated successfully, but these errors were encountered:
Hey nice package, but unfortunately not ESModule-compliant.
You use the
import
syntax in your documentation, and you even provide TypeScript types, which is a bit misleading because in the hood your script is CommonJS. That's bad practice.I am having a hard time integrating your lib into my TypeScript project.
You may want to consider turning your script into an ES Module anyway. Modern browsers support modules now it's safe, that means your package wouldn't technically need any compilation, you could just load it into the browser in a module context.
But you still can use it in a compilation process, most transpilers and bundlers understand modules now.
Technically you wouldn't need much headache, just adding
"type": "module"
in yourpackage.json
and changingmodule.exports = ...
toexport default ...
I guess.The text was updated successfully, but these errors were encountered: