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

Documentation: flaggedComments #127

Open
splitbrain opened this issue Mar 11, 2023 · 1 comment
Open

Documentation: flaggedComments #127

splitbrain opened this issue Mar 11, 2023 · 1 comment

Comments

@splitbrain
Copy link

It seems the API of this library is quite simple right now (I like it). However there's an option array being passed to the minify method. That options array seems to be undocumented currently. From a quick look at the code, the only option available is flaggedComments which can be true or false. But I am not sure what exactly this option does.

Could you describe what the option does?

@tedivm
Copy link
Member

tedivm commented Mar 11, 2023

Waaaay back in the day the Yahoo UI Compressor added a feature to preserve licenses. Basically if your multiline comment started with /*! instead of just /* then the Yahoo UI Compressor would not strip that comment out. This way libraries that wanted their licenses to be preserved even through minification could do so.

JShrink added that option and made it configurable through the flaggedComments value.

These days javascript compilers will still remove those comments but store them elsewhere. Webpack, for example, rips them out and stores them in a separate "licenses.txt" file. This way they don't violate the whole "attribution" portion of the licenses by stripping them out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants