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

Combine with webpack to list only really imported packages #81

Closed
pke opened this issue Sep 30, 2016 · 6 comments
Closed

Combine with webpack to list only really imported packages #81

pke opened this issue Sep 30, 2016 · 6 comments

Comments

@pke
Copy link

pke commented Sep 30, 2016

I wonder how this could be combined with webpack (as a preloader?) to only really gather information about packages that are imported or required by the app.

@davglass
Copy link
Owner

davglass commented Oct 3, 2016

I don't use webpack but from what I know it shouldn't be too hard to write a webpack plugin with this module as the base. I don't think that the logic for that belongs in this module tho. This module doesn't care about your build system, it only cares about the licenses of the modules that's installed :)

@davglass davglass closed this as completed Oct 3, 2016
@pke
Copy link
Author

pke commented Oct 3, 2016

I see, you are right. I quickly checked the source and it seems its not exposing a queryLicenseFromPackage method.

@davglass
Copy link
Owner

davglass commented Oct 3, 2016

I'd accept a PR to expose the things needed to use for other methods ;)

@pcworld
Copy link

pcworld commented Feb 11, 2018

There's a plugin which does this for webpack (doesn't depend on this library though): https://github.com/xz64/license-webpack-plugin

@unindented
Copy link

That plugin is pretty weak compared to this library.

@davglass are you still open to the idea of exposing another API that's not based on reading a directory from disk? Webpack already has a list of dependencies in memory, we'd just need to get the license for each.

@davglass
Copy link
Owner

@unindented I'd be open to it, as long as it doesn't effect the module too much. The parts that come from the disk are for modules that don't include their info in the package.json as they should, so it would still need to scan the disk to get it's data. Now if webpack can give us a list of all the source module directories, then it should be able to "just work" once it has the path info.

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

4 participants