How to specify alternate loader for intern

人盡茶涼 提交于 2019-12-25 01:45:20

问题


Is there a way to specify an alternate AMD loader for intern?

I use ESRI's ArcGIS API for JavaScript and unfortunately don't have access to their source code. So I'm stuck having to load their code from here.

Their API is build on top of Dojo, so I'm thinking that I should be able to test with intern if I can point it at their loader instead of the one that comes with intern.


回答1:


As of Intern 1.2, you can specify an alternate AMD loader for the browser client by changing <script src="node_modules/dojo/dojo.js"></script> within client.html, and for the command-line client by changing var req = require('dojo/dojo') in client.js. It is not currently possible to change the test runner’s loader (runner.js) because the Node.js module loader relies on being able to find the overridden Node.js require in another specific (non-standard) location.



来源:https://stackoverflow.com/questions/17788908/how-to-specify-alternate-loader-for-intern

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!