Javascript coffee-script.js中多个源文件的源映射
当我尝试使用多个.coffee文件时Javascript coffee-script.js中多个源文件的源映射,javascript,coffeescript,Javascript,Coffeescript,当我尝试使用多个.coffee文件时 <script data-src="js/file1.coffee" type="text/coffeescript"></script> <script data-src="js/file2.coffee" type="text/coffeescript" ></script> <script src="lib/coffee-script.js"></script>
<script data-src="js/file1.coffee" type="text/coffeescript"></script>
<script data-src="js/file2.coffee" type="text/coffeescript" ></script>
<script src="lib/coffee-script.js"></script>
2st脚本的内容是:
console.log 'file1'
console.log 'file1'
我只得到第一个文件的源映射。chrome控制台中的所有运行时错误和输出都引用了不存在的最后一个字符串file1.coffee
控制台输出为:
file1 file1.coffee:1
file2 file1.coffee:1
有时,coffeescript编译器将创建新文件的所有.coffee文件合并,然后生成一个.js文件,源文件指向该合并文件。有时,coffeescript编译器将创建新文件的所有.coffee文件合并,然后生成一个.js文件,源文件指向该合并文件。