question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Purge dependencies which are not called in runtime

See original GitHub issue

When bundling a project with prisma2 included as a dependency, a very large bundle (>50MB) gets generated, which may not be uploaded to AWS Lambda. While prisma2 is used for generating files during build time, it isn’t depended upon in runtime.

As mentioned here, inclusion and exclusion of modules should be possible. By default, files referred (transitively) by bin inside the package.json of each dependency should be excluded.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ehmickycommented, Nov 28, 2019

Awesome that it fixed you problem (except for the issue with nexus-prisma)! Don’t hesitate to join our Build Beta (if you haven’t yet), as there are several bug fixes related to Netlify Functions which are included in it. And please let us know of any other issues you might have 😃

1reaction
ehmickycommented, Nov 28, 2019

As @DavidWells is pointing out, the real fix for this issue would be the possibility to explicitly exclude specific node modules from the bundles, as outlined in #68.

I’ve just implemented a temporary workaround available in zip-it-and-ship-it@0.4.0-8 in the meantime, that should solve your specific case. This fix should also be available in our new Build beta.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Safe removal of "unused" runtime dependencies
I'd like to remove these "unused" dependencies, but I'm worried about the application failing at runtime. The ignoreNonCompile option I enabled ...
Read more >
Transforming dependency artifacts on resolution
When the dependency does not have a variant with the requested attributes, resolving the configuration fails. Sometimes it is possible to transform the...
Read more >
Managing Dependencies - UiPath Documentation Portal
To remove all unused dependencies in the project, select Remove Unused > Dependencies in the Studio ribbon, or use the Ctrl + Shift...
Read more >
Apache Maven Dependency Plugin – Usage
mvn dependency:purge-local-repository. To add the restriction that the org.apache.maven:maven-plugin-api artifact not be deleted, we ...
Read more >
Dependency injection in action - Angular
The TITLE provider token is not a class, but is instead a special kind of provider lookup key called an injection token, represented...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found