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

Babel transforms are not applied on external compilation #1

Closed
davenquinn opened this issue Aug 15, 2019 · 1 comment
Closed

Babel transforms are not applied on external compilation #1

davenquinn opened this issue Aug 15, 2019 · 1 comment

Comments

@davenquinn
Copy link
Member

At least with the Parcel bundler (but seemingly also with Webpack), the code in the lib/esm directory is compiled using the Babel transforms defined for neither the UI components module nor the overall application.

This seems to be a composition of two issues: 1. We don't compile the code in this module except to an ES6 target. Therefore, users must run Babel to get the ES6 code to a usable state, and 2. bundlers don't correctly treat this code as ES6 and transpile.

One weird sidebar with Parcel. When the package is linked with npm link, the correct transformations are applied and the app builds correctly; when it is installed normally from npm nothing works. This seems to relate to this aspect of the Parcel config, in which .babelrc files are sniffed out only if a module is symlinked into node_modules.

We need to either transpile the code in this module to some other target, or configure package.json so that the correct assumptions are made that the code is ES6 at bundle time. Doing the latter would have the benefit of allowing us to build to whatever target is required by a specific app.

@davenquinn
Copy link
Member Author

We appear to have fixed/circumvented this issue by transpiling everything to ES5. The fix is applied in d29eb4c and available at v0.1.1

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

No branches or pull requests

1 participant