Problematic use of babel-plugin-flow-react-proptypes in ESM build
See original GitHub issueThe use of babel-plugin-flow-react-proptypes in the es
Babel env causes many CJS require
calls to end up in what should be an ESM build. You can observe this in the published build; for example, List contains require('../Grid')
.
This largely defeats the purpose of an ESM build, since it means that most modules in the build cannot be tree-shaken under any circumstances.
The problem was introduced in #731 and there’s some discussion about the need for the plugin in #730.
P.S. thanks for your amazing work on this library ❤️
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
ES Modules are terrible, actually - gists · GitHub
Once the ecosystem supports ESM well, I think that yes, ESM will make building JavaScript applications easier since it's supported natively in browsers...
Read more >2 ESM interoperability issue with Node + Typescript + Webpack
At the end I've been able to figure out what was creating issues on the interoperability of the 2 ESM esm1 and esm2....
Read more >Node Modules at War: Why CommonJS and ES ... - Code Red
CJS scripts use require() and module.exports; ESM scripts use import… ... time as ESM named exports. But that would create a new problem....
Read more >Using ECMAScript modules (ESM) with Node.js
Learn about using ES modules in Node.js today and get a closer look at how you can migrate your codebase to make use...
Read more >How to Create a Hybrid NPM Module for ESM and CommonJS.
The problem with .mjs. Before outlining the solution, let me put a sword in a few much touted techniques. Why not just use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI it looks like the
babel-plugin-flow-react-proptypes
functionality was implemented via brigand/babel-plugin-flow-react-proptypes/pull/162 and published as 14.0.0.Fixed in 9.18.1