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

Dependencies licenses bundling ? #1740

Closed
aleks-ivanov opened this issue Nov 3, 2021 · 3 comments
Closed

Dependencies licenses bundling ? #1740

aleks-ivanov opened this issue Nov 3, 2021 · 3 comments

Comments

@aleks-ivanov
Copy link

Is there a way/plugin for esbuild to generate a licenses compilation text file, when bundling a Javascript app ?

@evanw
Copy link
Owner

evanw commented Nov 3, 2021

Documentation is here: https://esbuild.github.io/api/#legal-comments

@aleks-ivanov
Copy link
Author

aleks-ivanov commented Nov 3, 2021

Yes and as I understand legal comments refers to comments inside the source code only and not licenses in a separate file. Correct ?

@evanw
Copy link
Owner

evanw commented Nov 3, 2021

Yes, the license has to be in the source code. So a comment like // @license MIT will work.

If you want to do something different yourself, I recommend using the metafile, which tells you which files were included in the bundle. Then you can do whatever you like with that information (e.g. looking in each package for LICENSE.md files). This can be done either as an esbuild plugin or just after calling build().

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