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

fix: Set commonJS code as main in package.json #2276

Merged
merged 1 commit into from Nov 11, 2021
Merged

fix: Set commonJS code as main in package.json #2276

merged 1 commit into from Nov 11, 2021

Conversation

webstech
Copy link
Contributor

Change main to point to ./lib/marked.cjs instead of ./lib/marked.esm.js for compatibility with 'other' loaders (eg jest) in a non-ES module environment.

This was tested in an ESM repo both directly (node) and under jest with no problems.

Marked version:
4.0.0

Description

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

Change `main` to point to `./lib/marked.cjs` instead of
`./lib/marked.esm.js` for compatibility with 'other' loaders (eg jest)
in a non-ES module environment.

Signed-off-by: Chris. Webster <chris@webstech.net>
@vercel
Copy link

vercel bot commented Nov 10, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/markedjs/markedjs/6Jg5DMkvsjnaV1g4TuZ1XUsve8yy
✅ Preview: https://markedjs-git-fork-webstech-cw-main-as-common-markedjs.vercel.app

@UziTech
Copy link
Member

UziTech commented Nov 10, 2021

@benmccann this was changed in #2227. I just want to make sure this won't break what you were trying to fix.

@benmccann
Copy link
Contributor

Yes, this change is fine with me. It's more common to put CJS as the main. I think at one point in the PR converting to ESM we didn't have a CJS build and this is probably left over from then. I tested this change against a SvelteKit / Vite project and it works fine there

Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@UziTech UziTech merged commit 7e636d5 into markedjs:master Nov 11, 2021
github-actions bot pushed a commit that referenced this pull request Nov 11, 2021
## [4.0.1](v4.0.0...v4.0.1) (2021-11-11)

### Bug Fixes

* Set commonJS code as `main` in `package.json` ([#2276](#2276)) ([7e636d5](7e636d5))
@github-actions
Copy link

🎉 This PR is included in version 4.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript and Jest Compatibility with v4.0.0
4 participants