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

Add module condition, so webpack loads es6 module version #129

Merged
merged 2 commits into from
Oct 9, 2020

Conversation

weswigham
Copy link
Member

Even when handling the exports table, as done in webpack 5. webpack 5, at least at present per this thread, doesn't handle esm/cjs interop the same way as node, so we can't use the same source as in node.

This should hopefully cause webpack to uniformly prioritize the es module sources, as it did because of the module entrypoint before we added exports.

@orta you mentioned having a webpack 5 test - care to add it to this PR?

Even when handling the `exports` table, as done in `webpack` 5. `webpack` 5, at least at present, doesn't handle esm/cjs interop the same way as `node`, so we can;t use the same source as in `node`.
@orta
Copy link
Contributor

orta commented Oct 9, 2020

Confirmed that this fixes the issue in the repro from webpack/webpack#11613 (comment)

Both:

"webpack": "./tslib.es6.js",

and

"module": "./tslib.es6.js",

Work. Gonna look into why this wasn't the case in #131

@weswigham
Copy link
Member Author

Alright, I've swapped to module - just need some tests and we can merge/backport, probably?

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