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

Predicate breaks create-react-app build process #10

Closed
czycha opened this issue Mar 12, 2018 · 5 comments
Closed

Predicate breaks create-react-app build process #10

czycha opened this issue Mar 12, 2018 · 5 comments

Comments

@czycha
Copy link

czycha commented Mar 12, 2018

Predicate is a deep dependency of a React component that I'm using for a web app that I'm building off of create-react-app.

Running the app, everything works great. However, when trying to build the app for deployment, it isn't able to do so since Predicate uses ES6 features and cannot be minified.

This is mainly because the entry point of this module is index.js, which is ES6, instead of the precompiled version in the dist folder. As this is a deep dependency, I cannot just simply import "predicate/dist/predicate" instead of "predicate"—this change needs to happen in the module which depends on Predicate.

Should Predicate have its entry-point be changed to the non-ES6 compiled version in the dist folder, or should I ask the maintainer of the module which depends on Predicate to change their imports to the dist folder?

@czycha czycha changed the title Predicate breaks create-react-app Predicate breaks create-react-app build process Mar 12, 2018
@landau
Copy link
Owner

landau commented Mar 13, 2018

I am extremely hesitant to change predicate back to ES5. This module intends to follow Node LTS.

It seems more appropriate to me that the maintainer of the module you're using publish their module as ES5 since react is mostly a FE concern. Though, this is actually stems from create-react-app's inability to handle 3rd party modules appropriately.

You may want to consider switching to webpack or browserify as you may run into this issue again with another module. Thanks for reaching out.

@czycha
Copy link
Author

czycha commented Mar 13, 2018

Yeah I agree. create-react-app should have a different process for dealing with modules since each module is different. Unfortunately, webpack and browserify aren't options since create-react-app abstracts the build process from the developer. I'll contact the module maintainer. Thanks for your timely reply.

@czycha czycha closed this as completed Mar 13, 2018
@landau
Copy link
Owner

landau commented Mar 13, 2018

Sure thing. :)

What I meant by switching to webpack was to abandon create-react-app as your application builder. I believe webpack works well with babel, which works well with react applications.

@czycha
Copy link
Author

czycha commented Mar 13, 2018

Ahhh I understand. Yeah that could be an option.

@landau
Copy link
Owner

landau commented Mar 13, 2018

Good luck.

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