-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
minify should not remove licence comments #6677
Comments
Looks like we don't remove them, we just don't print them, try to disable |
Been doing some research: The defacto standard has been to not remove comments with an exclamation at the start:
Only |
When I specify an empty object for minify in playground Also, when I run it locally, the license comment is preserved, but the documentation says the default is false. |
esbuild has now re-enabled their comment preservation, so swc is the only minifier that I'm aware of that has this disabled by default See for rationale: |
@tbjgolden I was just looking into minifier license preservation too, at least if I don't specify a config file, the license comments are preserved. I confirmed that Nextjs13 (which uses swc internally) also preserve the license comments. please see my above comment. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Describe the bug
Many users will be unaware that they could be breaking their software licence by having
minify: true
.Other minifiers seem to use the convention that if a comment:
/*! license ... */
or//! license ...
), OR/** @license */
that it should not be removed with the default minify settings.
Input code
Config
Playground link
https://play.swc.rs/?version=1.3.23&code=H4sIAAAAAAAAA9PXUlTISM3JyVcozy%2FKSVHQ0ufiSsvP19C05gIAxeneNhsAAAA%3D&config=H4sIAAAAAAAAA0WMSwrDMAxE76K1t%2B0id8ghhKsEF%2F%2BQFIgxvnvlkpCdZubpdfiKh6VDRRbieUnLiicsQD6heA5VwRlm1YZRaDhQ5J10IvKyLZYidK0OUshha9PkS6pMIs%2BEeY83OUyUyueYRQdtlf7CN4zHoXzYW5D14mYeP5P5%2B3m0AAAA
Expected behavior
Comment is not removed
Actual behavior
Commit is removed
Version
1.3.23
Additional context
No response
The text was updated successfully, but these errors were encountered: