require js jquery plugins

早过忘川 提交于 2019-12-23 11:24:46

问题


Do I have to write wrappers for each jQuery plugin I am trying to use in require.js? I can't user the order plugin they still give me the error that they depend on jQuery.

Thanks


回答1:


RequireJS 2.0 has a shim option that allows you to use older non-AMD scripts as modules - http://requirejs.org/docs/api.html#config-shim




回答2:


Have you read How to use require js with jquery? It explains that you can use require js to load jquery and jquery plugins by using a combined jquery/requirejs file. You can find a sample project here. There are also several alternative strategies listed in the sample project's readme.



来源:https://stackoverflow.com/questions/10799331/require-js-jquery-plugins

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