生成从Coffeescript编译的多个拼接的JavaScript文件的源映射 [英] Generating source maps for multiple concatenated javascript files compiled from Coffeescript

查看:170
本文介绍了生成从Coffeescript编译的多个拼接的JavaScript文件的源映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有任何成功与此?

推荐答案

我认为它或多或少是未解决的问题:
https://github.com/jashkenas/coffee-script/issues/2779 。最后一个意思是来自jwalton,一个月前。

I think it's more or less an unsolved problem: https://github.com/jashkenas/coffee-script/issues/2779 . Last meanigingful comment was from jwalton, a month ago.

但是,它似乎并没有火箭科学添加支持,所以很可能会很快。

Still, it doesn't seem rocket science to add support for it, so it will probably come soon.

Michael Ficarra(CoffeeScript Redux的创建者)建议使用 https://github.com/michaelficarra/commonjs-everywhere

Michael Ficarra (creator of CoffeeScript Redux) suggested using https://github.com/michaelficarra/commonjs-everywhere .

两个注意事项:


  • 仅适用于捆绑CommonJS模块。 li>
  • 它使用CoffeeScript Redux,它仍处于测试版(虽然工作相当好看起来),而不是100%兼容原始的CoffeeScript编译器。

因此,这不适用于您要求的连接。

So this does not work for what you ask for specifically, "concatenation".

您可能有这些运气: combine-source-map 和/或 generate-sourcemap

You might have luck with these: combine-source-map and/or generate-sourcemap, both by same author.

这看起来很简单: https://npmjs.org/package/mapcat

Mariusz Nowak 刚刚发布了 webmake-coffee 。像CommonJS Everywhere,它需要代码组织为CommonJS模块。与CommonJS不同,它使用常规CoffeeScript。

Mariusz Nowak has just released webmake-coffee. Like CommonJS Everywhere, it requires code to be organized as CommonJS modules. Unlike CommonJS everywhere, it uses regular CoffeeScript.

这似乎也是 Grunt Coffee-Script插件对连续文件提供了源映射支持一段时间(两个月),有效地证明我的原始答案不正确。

It also seems the Grunt Coffee-Script plugin has had source-map support for concatenated files for quite a while (two months), effectively proving my original answer to be incorrect.

即将推出的2.0版Snockets也将支持它。

The upcoming version 2.0 of Snockets will have support for it too.

这篇关于生成从Coffeescript编译的多个拼接的JavaScript文件的源映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆