CoffeeScript 在闭包中包装块标题注释
我有以下 CS 片段:
###
jQuery Observer
Copyright 2011 All Rights Reserved
###
$ = jQuery
...
编译为:
(function() {
/*
jQuery Observer
Copyright 2011 All Rights Reserved
*/
var $;
$ = jQuery;
...
}).call(this);
但是,我希望标头注释出现在文件的顶部(而不是在闭包内)。 CS里可以设置吗?
I have the following CS snippet:
###
jQuery Observer
Copyright 2011 All Rights Reserved
###
$ = jQuery
...
Which compiles to:
(function() {
/*
jQuery Observer
Copyright 2011 All Rights Reserved
*/
var $;
$ = jQuery;
...
}).call(this);
However, I'd like the header comment to appear at the top of the file (not inside the closure). Is this settable within CS?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前还没有办法做到这一点,但有一个开放的拉取请求看起来很有希望: https: //github.com/jashkenas/coffee-script/pull/1684
There's currently no way to do this, but there is an open pull request which looks promising: https://github.com/jashkenas/coffee-script/pull/1684