Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add package.json with type: module to esm directory#6897

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
nwalters512 wants to merge2 commits intoreact-bootstrap:master
base:master
Choose a base branch
Loading
fromnwalters512:node-native-esm

Conversation

nwalters512
Copy link
Contributor

This is necessary for Node and similar environments to treat the contents of theesm directory as ES Modules. Otherwise both Node and TypeScript get quite confused.

This is a step in the right direction of resolving#6797. After this change, one should be able to write the following in a TypeScript file:

importModalDialogfrom`react-bootstrap/esm/ModalDialog.js`;functionMyComponent(){return<ModalDialog></ModalDialog>;}

Importing e.g.react-bootstrap/ModalDialog doesn't yet work. And the above still doesn't work at runtime because the code inesm/ModalDialog.js isn't actually valid ESM, as it doesn't use extensions on its imports. I'd like to work towards resolving these issues in future PRs, as they're blocking the use ofreact-bootstrap in my application.

@kyletsang
Copy link
Member

Thanks for the PR. I'm going to be looking into adding proper support for this in the near future as part of a v3 release. Still taking care of some maintenance and upstream deps before doing so

@nwalters512
Copy link
ContributorAuthor

That's fantastic to hear! Let me know if you want a sounding board for any plans there, I've helped fix up several other dependencies of mine that don't quite do the right thing at the intersection of ESM/Node/TypeScript.

@kyletsangkyletsang mentioned this pull requestFeb 10, 2025
@reteps
Copy link

Any progress on this?

@kyletsang
Copy link
Member

Any progress on this?

See#6939

reteps reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@nwalters512@kyletsang@reteps

[8]ページ先頭

©2009-2025 Movatter.jp