简体   繁体   English

如何使用grunt-contrib-less进行压缩而不丢失标语文字?

[英]How to compress with grunt-contrib-less without losing the banner text?

I'm trying to compress a bunch of less files using Grunt with the plugin grunt-contrib-less using the option: 我正在尝试使用带有选项grunt-contrib-less的Grunt压缩少量文件:

compress: true

But when I run the Grunt task it removes the banner that is actually a comment. 但是,当我运行Grunt任务时,它会删除实际上是评论的标语。

 banner:'/*\nTheme Name: maugelves.com \n' +
        'Theme URI: http://maugelves.com\n' +
        'Description: MauGelves.com Theme\n' +
        'Version: 1.0.0\n' +
        'Author: Mauricio Gelves (@maugelves)\n' +
        'License: MIT\n*/'

As you can notice I'm trying to develope a WordPress theme and it's necessary to have this comment on the top of my style.css in order to keep it working. 如您所见,我正在尝试开发WordPress主题,因此有必要在style.css顶部添加此注释,以使其正常运行。

Do you know a workaround to solve this problem? 您知道解决此问题的解决方法吗?

Thanks! 谢谢!

Try starting with banner:'/*! 尝试以banner:'/*!开头banner:'/*! - I know that works with CSS comments. -我知道这适用于CSS注释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM