-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add comment header to bundle #2459
Comments
Pretty sure it's not an issue to have license headers above the actual licensed code instead of on top of the bundle. Pretty sure terser doesn't remove license headers by default and neither does parcel. |
terser will remove all comments by default unless you pass Since each module by default is on its own newline from what I can tell, the module's license header can get lost down at the bottom. And the newline after the license header appears to be stripped (probably a terser bug). So it just becomes very difficult to see. Try to find the license header in this: http://noclip.website/main.cdfad9f2.js |
@magcius Thought the original issue was about license headers of libraries, but bundler licenses makes sense. Although not sure how this should be implemented. |
@DeMoorJasper Is there interest from the maintainers to add a comment header to the bundle? I would be happy to take this on, as I'm hitting this issue in processing/p5.js#3431. I think it would be relatively straightforward. I think we could add the option in as 'bundleHeader' (or maybe 'banner' like rollup?), which would be an optional string.
and write in the bundle somewhere near parcel/packages/core/parcel-bundler/src/packagers/Packager.js Lines 17 to 26 in eb759a4
This would let us write the same string at the top of every package file type, and require no modification of plugins to support. |
@outofambit yes feel free to work on this issue. Itβll be necessary at some point Sent with GitHawk |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
β Question
Hi. How can I provide a comment header in the final bundle output?
π¦ Context
I would like to point users to where they can see the original GitHub project.
This is also a legal requirement to include proper license headers on external modules. I tried using "@preserve" JSDoc, and while terser does seem to include it sometimes, it's tucked away in a module (which is in random order in the final output), and it doesn't seem to consistently be kept in the output, bizarrely enough.
π» Code Sample
None.
π Your Environment
The text was updated successfully, but these errors were encountered: