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

Npm is released in ES6 causing build failures for projects not using babel-preset-0 #61

Closed
jsarman opened this issue Aug 8, 2018 · 4 comments

Comments

@jsarman
Copy link
Contributor

jsarman commented Aug 8, 2018

When another project depends on the library that uses a babel-preset that is greater than 0, the production build can fail with error like
Failed to minify the code from this file: ./node_modules/@availity/api-core/src/api.js:5
Specifically this is occurring from a project using react-scripts.
See http://bit.ly/2tRViJ9 which recommends compiling npm packages to ES5 for at least a few more years until the ecosystem catches up.

@robmcguinness
Copy link
Contributor

Hi @jsarman,

This was intentional. Toolkits like create-react-app and availity-workflow are configured to consume libraries that are written in ES6. We should probably update the docs to make that clear. All our libs are written and published this way.

@jsarman
Copy link
Contributor Author

jsarman commented Aug 8, 2018

@robmcguinness
create-react-app is not at level babel-preset-stage-0 since some features may not be promoted. This causes any app that is built with create-react-app to either need to eject or to transpile the dependencies before attempting a production build. I do not disagree with ES6, but maybe we should consider building core libraries using babel-preset-stage-3.

@robmcguinness
Copy link
Contributor

ref: facebook/create-react-app#3776

@robmcguinness
Copy link
Contributor

This should be supported by CRA now

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

2 participants