Skip to content

Conversation

@kemayo
Copy link
Contributor

@kemayo kemayo commented Oct 27, 2016

Comment blocks that start with /*! are trying to flag themselves as licenses, and should be left in minified source for copyright purposes.

Comment blocks that start with `/*!` are trying to flag themselves as licenses, and should be left in minified source for copyright purposes.
@PeterDaveHello
Copy link
Owner

Thanks @kemayo! Since the src is still there, I wonder if this is necessary? Maybe the users can just fetch the src for license info? I'm also concern about if that still always for license info, maybe not, right? Preserving some comment block for small files may also cause the issue about "minify or not", since the minified file + map file may be even greater than the origin one. What do you think?

@kemayo
Copy link
Contributor Author

kemayo commented Oct 27, 2016

There's two arguments here, intention-based and legal.

Intention-based is simpler: we're leaving in comment blocks that the library author has explicitly tagged as "I want this preserved even through minification", so we should probably respect that.

Legal requirements are more fiddly, and I acknowledge that most people will wind up saying "eh, it's a minified version, that's okay". Most open source licenses say that you have to include it with any source distribution, and the minified version is still source. So if you strip it, you're (technically) breaking the license agreement and thus aren't allowed to distribute it at all.

e.g. the MIT says "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software." GPL and BSD contain similar provisions.

@kemayo
Copy link
Contributor Author

kemayo commented Oct 27, 2016

Oh, the size concern, sorry.

Minified-with-license + map might, in edge cases, be bigger than the original. However, source maps are only downloaded if the dev tools are open, so the end-user should always be getting a smaller download. (The added content from source maps before you open the dev tools is one comment, which is about 30 characters long, so...)

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

Successfully merging this pull request may close these issues.

2 participants