我使用Visual Studio 2015RC + Cordova CLI 5.1.1 + TypeScript + RequireJS + jQuery。Visual Studio 2015 RC + RequireJS + jQuery
我想将我的jquery.js文件的位置从scripts
文件夹更改为scripts/lib
。我添加了一个requirejs.config并更改了jQuery位置。
requirejs.config({ baseUrl: 'scripts/lib', paths: { jquery: 'jquery' } });
不幸的是,当我调试使用纹波我碰到下面的错误。 Exception occurred Message: Exception: Script error for: jquery http://requirejs.org/docs/errors.html#scripterror
我不知道这是否与RequireJS和jQuery或VS2015RC +科尔多瓦的一个问题。
这可能与TypeScript无关,只是脚本加载错误。控制台的任何与加载或解析jquery文件有关的错误 –
这绝对是一个脚本加载错误'404'。不幸的是,当我在涟漪调试时,它总是寻找scripts/jquery.js,即使'requirejs.config'被设置为使用不同的位置。我创建了一个示例VS2015 Cordova项目来说明问题。从[https://github.com/dbiele/Testing_CordovaJQueryRequireJSTypeScript](https://github.com/dbiele/Testing_CordovaJQueryRequireJSTypeScript)下载文件 –