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

Change package.json to type: "module", fix commitlint module export error #230

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

geyang
Copy link

@geyang geyang commented Aug 10, 2024

This PR addresses the module type issue #208

Mainly:

  • add type: "module" to package.json so that it works with vite projects without needing the cjs interpolation. In vite, the cjs interpolate does not work consistently when we switch between preview, build, and SSR in dev modes.
  • change the main to "index.esm.js" according to this comment.
  • now type="module", the commitlint export is faulty. Change the .js postfix to .cjs to fix module resolution error.

@staylor let me know if there are issues you want me to address.

@daniel-ac-martin
Copy link

daniel-ac-martin commented Aug 28, 2024

@geyang: Does eslint.js also need to be renamed to eslint.cjs?

@daniel-ac-martin
Copy link

Thinking about it, I think this would be a breaking change, as I don't think CommonJS modules would be able to import this package any more.

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.

2 participants