Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

require js jquery plugins

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

like image 840
onlineracoon Avatar asked May 29 '12 12:05

onlineracoon


2 Answers

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

like image 160
Simon Smith Avatar answered Sep 18 '22 20:09

Simon Smith


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.

like image 29
Ryan Lynch Avatar answered Sep 21 '22 20:09

Ryan Lynch