<tfoot id='71V2b'></tfoot>
      <bdo id='71V2b'></bdo><ul id='71V2b'></ul>

      <small id='71V2b'></small><noframes id='71V2b'>

    1. <legend id='71V2b'><style id='71V2b'><dir id='71V2b'><q id='71V2b'></q></dir></style></legend>
    2. <i id='71V2b'><tr id='71V2b'><dt id='71V2b'><q id='71V2b'><span id='71V2b'><b id='71V2b'><form id='71V2b'><ins id='71V2b'></ins><ul id='71V2b'></ul><sub id='71V2b'></sub></form><legend id='71V2b'></legend><bdo id='71V2b'><pre id='71V2b'><center id='71V2b'></center></pre></bdo></b><th id='71V2b'></th></span></q></dt></tr></i><div id='71V2b'><tfoot id='71V2b'></tfoot><dl id='71V2b'><fieldset id='71V2b'></fieldset></dl></div>

      合并两个编译步骤的 source maps

      Combine source maps of two compilation steps(合并两个编译步骤的 source maps)
      <legend id='TzKUs'><style id='TzKUs'><dir id='TzKUs'><q id='TzKUs'></q></dir></style></legend>

        • <bdo id='TzKUs'></bdo><ul id='TzKUs'></ul>
          <i id='TzKUs'><tr id='TzKUs'><dt id='TzKUs'><q id='TzKUs'><span id='TzKUs'><b id='TzKUs'><form id='TzKUs'><ins id='TzKUs'></ins><ul id='TzKUs'></ul><sub id='TzKUs'></sub></form><legend id='TzKUs'></legend><bdo id='TzKUs'><pre id='TzKUs'><center id='TzKUs'></center></pre></bdo></b><th id='TzKUs'></th></span></q></dt></tr></i><div id='TzKUs'><tfoot id='TzKUs'></tfoot><dl id='TzKUs'><fieldset id='TzKUs'></fieldset></dl></div>
                <tbody id='TzKUs'></tbody>

                <tfoot id='TzKUs'></tfoot>

                <small id='TzKUs'></small><noframes id='TzKUs'>

                本文介绍了合并两个编译步骤的 source maps的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我的 Web 应用程序有一个两步编译过程.首先,我将 CoffeeScript 文件编译成 JavaScript 文件 [1].然后 JavaScript 文件(来自 CoffeeScript 的文件和外部文件,如 grunt-angular-templates 从 AngularJS 模板生成的文件)由 Google Closure Compiler [2] 编译成单个最小化文件.

                I've got a two-step compilation process for my web application. Firstly, I compile CoffeeScript files into JavaScript files [1]. Then the JavaScript files (both ones that come from CoffeeScript, and external ones, like produced from AngularJS templates by grunt-angular-templates) are compiled by Google Closure Compiler [2] into a single minimized file.

                CoffeeScript ---[1]---> JavaScript --[2]--
                                                           ->
                AngularJS templates --> JavaScript ----------> single minimized JS file
                                                           /->
                                    other JS files -------/
                

                步骤 [1] 和 [2] 都生成源映射.

                Both steps [1] and [2] produce source maps.

                是否可以将这些源映射组合成一个单一的源映射,这样我就可以从运行最小化 JS 文件的 Web 浏览器中调试 CoffeeScript 文件?

                Is it possible to combine these source maps into a single source map that would allow me to debug CoffeeScript files from a web browser that runs the minimized JS file?

                换句话说:假设源映射 [1] 由一个函数表示:

                In other words: let say the source map [1] is represented by a function:

                f(position in CoffeeScript) = position in JavaScript
                

                源图[2]用一个函数表示:

                and the source map [2] is represented by a function:

                g(position in JavaScript) = position in minimized JS
                

                我想得到一个由函数组合表示的源映射:

                I'd like to get a source map which is represented by a function composition:

                h(position in CoffeeScript) = g(f(position in CoffeeScript)) = 
                                            = position in minimized JS
                

                推荐答案

                试试 巫术 - 就是正是为此目的而设计的(我是作者,我来这里是为了寻找相关工具的信息).只要 .map 文件位于正确的位置(或作为数据 URI 内联),您只需在生成的文件上运行 sorcery ,它就会找到中间源映射和组合它们.

                Try sorcery - it's designed for exactly this purpose (I'm the author, I came here looking for info on related tools). As long as the .map files are in the correct location (or inlined as data URIs), you just run sorcery on the generated file and it will locate the intermediate sourcemaps and compose them.

                这篇关于合并两个编译步骤的 source maps的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                Rails 3.1 ajax:success handling(Rails 3.1 ajax:成功处理)
                CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                Ordinals in words javascript(javascript中的序数)
                getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)

                    <tbody id='wReL5'></tbody>

                    • <small id='wReL5'></small><noframes id='wReL5'>

                    • <i id='wReL5'><tr id='wReL5'><dt id='wReL5'><q id='wReL5'><span id='wReL5'><b id='wReL5'><form id='wReL5'><ins id='wReL5'></ins><ul id='wReL5'></ul><sub id='wReL5'></sub></form><legend id='wReL5'></legend><bdo id='wReL5'><pre id='wReL5'><center id='wReL5'></center></pre></bdo></b><th id='wReL5'></th></span></q></dt></tr></i><div id='wReL5'><tfoot id='wReL5'></tfoot><dl id='wReL5'><fieldset id='wReL5'></fieldset></dl></div>
                      <legend id='wReL5'><style id='wReL5'><dir id='wReL5'><q id='wReL5'></q></dir></style></legend>

                        <tfoot id='wReL5'></tfoot>
                        • <bdo id='wReL5'></bdo><ul id='wReL5'></ul>