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

react-scripts dependency excluded from output bundle #2449

Closed
timkendrick opened this issue Jan 7, 2018 · 5 comments · May be fixed by qcif/data-curator#563
Closed

react-scripts dependency excluded from output bundle #2449

timkendrick opened this issue Jan 7, 2018 · 5 comments · May be fixed by qcif/data-curator#563
Labels

Comments

@timkendrick
Copy link

  • Version: 19.52.1
  • Target: mac

I'm currently working on an Electron app that allows users to compile their own React projects. One of the dependencies of the app is react-scripts.

I couldn't figure out why the react-scripts dependency was being excluded from the output bundle, even though it is listed as a dependency of the main app (not a devDependency).

After trying all sorts of increasingly crazy attempts to get my project building, I finally managed to track this down to Electron Builder's set of knownAlwaysIgnoredDevDeps in electron-builder-lib/util/packageDependencies.ts. When I manually edit the electron-builder code and remove react-scripts from this set, it is copied into the output correctly.

Does this mean that these exclusions are incorrectly being applied to dependencies, not just devDependencies?

@develar
Copy link
Member

develar commented Jan 31, 2018

Removed from knownAlwaysIgnoredDevDeps.

@timkendrick
Copy link
Author

Thanks for the fix!

My only slight concern is that this issue could potentially also apply to any of the other dependencies in that list (e.g. jest).

I guess ideally electron builder could figure out which packages to filter out by checking against the package.json and seeing which are devDependencies and which are dependencies, and not including the devDependencies?

Or alternatively, maybe this list could be configurable so that you can override the default list if your app has unusual requirements?

Thanks for making the fix though, it fixes my problem at least!

@develar
Copy link
Member

develar commented Jan 31, 2018

Why jest can be required?

@timkendrick
Copy link
Author

Jest might be required e.g. if you're building a jest test runner GUI app for writing quick TDD-style experiments/fiddles.

I imagine that in this scenario you'd want to bundle the jest library to avoid having to set up a whole new npm project each time you launch the app.

@develar
Copy link
Member

develar commented Feb 2, 2018

Already excluded from list :) Thanks for explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants