Rails assets - keep license comments

2020-08-22 03:02发布

How can I prevent Uglifier from removing some comments from some files? I want to have code minified and compressed but also I want the licensing comments to remain intact.

1条回答
Viruses.
2楼-- · 2020-08-22 03:52

From the documentation of uglifyJS.

-nc or --no-copyright — by default, uglifyjs will keep the initial comment tokens in the generated code (assumed to be copyright information etc.). If you pass this it will discard it.

which is also an option of uglifier.

查看更多
登录 后发表回答