【问题标题】:url scheme meteor://????app/..... in meteorjsurl方案meteor://????app/.....在meteorjs中
【发布时间】:2016-04-17 19:06:43
【问题描述】:

这个 url-scheme/protocol 是什么意思?流星://????app/.....

我在浏览器开发人员工具中打开一个流星项目时看到它。所有编译/转译/缩小的文件都在http://localhost:3000 下。但是,源映射指向的所有源文件都在另一个名为 meteor://????app

的目录中

当我尝试在浏览器中打开这些路径(或通过在新选项卡中选择打开链接)时,它说无法打开它们。

流星如何为他们服务? chrome调试工具是如何访问的? chrome调试工具怎么知道“meteor://”怎么办?

developer tools with http://location:3000 and meteor://..app

.js.map 文件中的示例: {"version":3,"sources":["meteor://????app/password_client.js"],"names"

【问题讨论】:

    标签: meteor source-maps


    【解决方案1】:

    如果其他人都想知道这是如何工作的.....

    原始源代码可以包含在源映射(sourcesContent)中。如果您在那里提供它,您可以将任何您喜欢的路径放在“源”中,开发工具将在其自己的文件夹中显示它,如问题中的图片所示。

    尝试:

    mkdir example
    cd example
    npm install babel-cli #needed to compile and create source map
    
    #create a hello world js website:
    echo "document.write('hello world')  ;  //spaces before ; will be removed in transpiled file" > hello.js
    echo "<script src='hello-compiled.js'></script>" > hello.html
    
    #create compiled version and source map
    node ./node_modules/babel-cli/bin/babel hello.js --out-file hello-compiled.js --source-maps
    
    cat hello-compiled.js #to see the generated map file
    sed -i 's/hello.js/sourcefiles:\/\/sourcesfiles\/hello.js/g' hello-compiled.js.map #change the local url to one with the new protocol
    cat hello-compiled.js #to see the map file after the change
    #(or just open up the file in an editor and change sources":["hello.js"] to sources":["sourcefiles://sourcefiles/hello.js"]
    
    rm hello.js #get rid of the original so that you don't see it in your sources
    #(you can always regenerate it with the echo command above)
    
    google-chrome hello.html #on ubuntu if you have chrome installed
    open hello.html #will probably work on osx
    
    ##now look at sources in developer tools - you should see source files in theor own folder called sources
    #I had to ctrl-shift-r to see all the files
    #you should be able to add a breakpoint in the sourcefiles://sourcefiles/hello.js
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-01
      • 2013-11-05
      • 1970-01-01
      • 2021-10-22
      • 1970-01-01
      • 2019-10-03
      • 2016-08-05
      • 2017-10-18
      相关资源
      最近更新 更多