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

Way to only check production dependencies #13

Open
rickysullivan-gallagher opened this issue Dec 13, 2020 · 1 comment
Open

Way to only check production dependencies #13

rickysullivan-gallagher opened this issue Dec 13, 2020 · 1 comment

Comments

@rickysullivan-gallagher

Is there a way to only check production dependencies?

@eladnava
Copy link
Owner

eladnava commented Dec 15, 2020

Hi @rickysullivan-gallagher,
Thanks for filing this issue.

Indeed, there isn't a way to do that currently. This package depends on legally to obtain your project's dependencies, by recursively walking over your project's node_modules/ folder, with no regard whatsoever as to whether the dependency or sub-dependency is dev/prod only. Changing this to include a dev/prod check would require a rewrite of legally, to inspect your project's package.json and avoid obtaining licenses for dev dependencies, or their sub-dependencies (unless a sub-dependency is also referenced by a prod dependency). As you can see, this can get complicated fast.

The easiest way to achieve this, without modifying legally, is to simply create a new project directory and run npm install on all of your project's production dependencies only. Then, run tldrlegal in that directory instead. After obtaining the results, you can delete this directory.

Please let me know if this make sense.

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