How do I use requireJS and jQuery together?

前端 未结 5 1460
暗喜
暗喜 2020-11-30 16:14

I would like to use requireJS and I am using jQuery. I don\'t want to use the combined version of requireJS and jQuery since I am not using the latest jQuery version. What i

5条回答
  •  [愿得一人]
    2020-11-30 16:58

    I've found the best approach is to keep jQuery outside of my RequireJS build.

    Just include jquery.min.js in your HTML. Then, make a jquery.js file with something like this...

    define([], function() {
        return window.$;
    });
    

提交回复
热议问题