Hi. How can I provide a comment header in the final bundle output?
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.
None.
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.10.0
| Node | v10.0.0
| npm/Yarn | npm v6.5.0
| Operating System | Windows 10
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 { "output": { "comments": "some" } }.
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
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.