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 CRA v5 compatibility by publishing lib and app as CommonJS packages #1000

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

axelboc
Copy link
Contributor

@axelboc axelboc commented Mar 8, 2022

Fix #986

With "type": "module", webpack v5 enforces Node-compliant paths. For react-icons/fi, this should be react-icons/fi/index.esm.js, but if I do this in the codebase, then TypeScript complains that it can't find the types...

I think this is linked to the way the react-icons package is organised, but not sure it's worth reporting since it works fine with "type": "module" removed (or rather overridden with its default value "commonjs" when published).

packages/lib/src/vis/utils.ts Outdated Show resolved Hide resolved
@axelboc axelboc requested a review from loichuder March 8, 2022 16:10
@axelboc
Copy link
Contributor Author

axelboc commented Mar 8, 2022

Once merged, I'll do a beta release to double check.

Copy link
Member

@loichuder loichuder left a comment

Choose a reason for hiding this comment

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

Thanks ❤️ !

packages/lib/src/vis/utils.ts Outdated Show resolved Hide resolved
"require": "./dist/index.cjs",
"import": "./dist/index.js"
"require": "./dist/index.js",
"import": "./dist/index.esm.js"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had forgotten to change the cjs extension back to js ... not that it matters since we point to the exact filenames.

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.

CRA v5 compatibililty
2 participants