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: add js suffix in imports for esm support with babel #562

Merged
merged 2 commits into from
Feb 15, 2022

Conversation

AuHau
Copy link
Contributor

@AuHau AuHau commented Feb 15, 2022

Potentially superseeds the #561 with using Babel to add the .js suffix and hopefully still functional tests.

Closes #555

@AuHau AuHau marked this pull request as ready for review February 15, 2022 14:37
Copy link
Contributor

@vojtechsimetka vojtechsimetka left a comment

Choose a reason for hiding this comment

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

LGTM, definitely like it better than specifying .js suffixes in the TS files :)

import getMajorSemver from 'semver/functions/major'
import getMajorSemver from 'semver/functions/major.js'
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for me to understand. These library imports have to have .js appended because they are also ESM? So if some other dependency (e.g. js-sha3) gets updated and bundeld as ESM, we would also add the suffix there?

@AuHau AuHau merged commit 62489aa into master Feb 15, 2022
@AuHau AuHau deleted the fix/js-suffix-yab branch February 15, 2022 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot bundle with webpack
2 participants