3

如果我将我的路径配置指定为远程 url,它们可以正常加载。

require.config({
  paths: {
    jquery: '//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min',
    underscore: '//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.1/underscore-min',
    backbone: '//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min',
    mustache: '//cdnjs.cloudflare.com/ajax/libs/mustache.js/0.7.2/mustache.min'
  }
})

如果我将它们移动到这样的本地文件:

require.config({
  paths: {
    jquery: 'libs/jquery-min',
    underscore: 'libs/underscore-min',
    backbone: 'libs/backbone-min',
    mustache: 'libs/mustache-min'
  }
})

然后它尝试将它们加载为libs/jquery-min.map. 我似乎无法弄清楚为什么它会附加.map扩展名。有任何想法吗?

4

1 回答 1

4

这不是必需的,但您的浏览器:

  1. http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/

  2. https://developers.google.com/chrome-developer-tools/docs/javascript-debugging#source-maps

于 2013-09-18T01:28:23.617 回答