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

Version 3.0.0 of the module does not include the required node_modules #3

Open
mgroeneweg opened this issue Oct 7, 2022 · 11 comments
Assignees

Comments

@mgroeneweg
Copy link

Version 3.0.0 of the module does not include the required node_modules.

Running npm install inside the module folder in javascriptsources could fix this but this brings in 700+ folders with well over 200Mb of files. Way too much to check in.

Deployment packages created with this release will also fail because the packager will not have these files as well.

Please include the node modules for the minimum required modules.

@ElineMendix
Copy link

Also running into this issue, would love to see it fixed.

@cdcharlebois cdcharlebois self-assigned this Aug 3, 2023
@cdcharlebois
Copy link
Owner

Please try the beta release here and let me know if that resolves your issue

@mgroeneweg
Copy link
Author

I downloaded the beta. It is well over 40Mb unpacked and still includes large libraries like React, React Native and the react devtools. Pruning non-JS stuff is a step but not enough. For NativeFileDocuments, I have removed any library that turned out to be dev dependency. I ship only 11 modules with the module, it would have been over 700 otherwise. Same here. The library does not need all these modules to work, these are dev dependencies.

@cdcharlebois
Copy link
Owner

I'm trying to find a middle ground between including no dependencies and letting the developer figure it out versus providing what's needed, without spending hours manually combing through dependencies. The script is a huge help. Do you have any other suggestions for automated ways to remove the extra dev dependencies? For NativeFileDocuments, did you just manually traverse the package.json files?

@mgroeneweg
Copy link
Author

For NativeFileDocuments, I moved any modules except the ones I installed away to a temp folder. Then I tested and moved back modules until I got no errors anymore. But I think there are libraries or even just NPM commands that let you weed out the dev dependencies.

@cdcharlebois
Copy link
Owner

interestingly, the @react-native-firebase packages don't list any dev dependencies

@cdcharlebois
Copy link
Owner

will try with npm prune --production and upload a new version here soon

@mgroeneweg
Copy link
Author

Would be interesting if that works. I will then try to see how that works on NativeFileDocuments

@cdcharlebois
Copy link
Owner

after npm prune --production no packages were removed and the exported mpk is still the same size (14.7MB). It seems like most deps are listed as peer

{
  "added": 0,
  "removed": 0,
  "changed": 44,
  "audited": 723,
  "funding": 33,
  "audit": {
    "vulnerabilities": {
      "info": 0,
      "low": 0,
      "moderate": 6,
      "high": 2,
      "critical": 0,
      "total": 8
    },
    "dependencies": {
      "prod": 77,
      "dev": 0,
      "optional": 0,
      "peer": 646,
      "peerOptional": 0,
      "total": 722
    }
  }
}

@cdcharlebois
Copy link
Owner

tried removing node_modules and running npm i --production to same result. Not sure how to safely remove peer deps without doing it manually.

@mgroeneweg
Copy link
Author

I ran npm install again in NativeFileDocuments and got the 300+ node modulesback. Then I ran npm prune --omit dev --omit peer and only 22 modules were still in node_modules. Perhaps that trick, and then pruning non-JS stuff, will work here.

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

3 participants