How to use my own version of jQuery with browserified modules

前端 未结 2 1644
你的背包
你的背包 2021-01-25 06:50

(I should clarify up front: My question is about closures and client module patterns in Javascript. It\'s not about how to use jQuery.noConflict().)

I\'ve got a bit of J

2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-25 07:51

    in my app.js I have this

    var $ = require('jquery')(window);  global.jQuery = require("jquery");
    

    and then use download from npm "plugin" and import de module and execute, like this.

    var plugin    = require('plugin');
    plugin();
    

    and works fine.

提交回复
热议问题