brigand / brigand/babel-plugin-flow-react-proptypes

named exports not functioning with `modules: false` in webpack

Open
#85 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
427
Forks
42
PR merge metrics
No merged PRs in 30d

Description

When using babel + webpack with `modules: false` `exports` is not defined. This is because webpack generates a module wrapper with a signature of `(function(module, __webpack_exports__, __webpack_require__) {`. [conditionalExportsAst](https://github.com/brigand/babel-plugin-flow-react-proptypes/blob/0d53ac919779a8e78e8ab2cc7ae6a5336e8771ee/src/index.js#L261) check is always false and named exports don't function as expected.

Configuring modules back to commonjs resolves the issue but it seems as though this should be supported.

[webpack reference](https://github.com/webpack/webpack/blob/796ba56e927480f6d866ffdae19095c481518988/examples/harmony-interop/README.md)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.