5

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
  • Could you explain more? Examples of the plugins you're trying to use and how you're combining them would be useful. It's worth noting that all jQuery plugins will obviously require a jQuery include somewhere on the same page, if that's the problem you're having. Commented May 29, 2012 at 12:41

2 Answers 2

11

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

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.