Using browserify with npm jQuery and non-npm plugins

后端 未结 3 1729
孤街浪徒
孤街浪徒 2021-02-01 07:09

I am using browserify to bundle front-end code. It\'s been great so far, but I\'ve been having difficulty mixing npm and non npm packages. For example, using the npm version of

3条回答
  •  名媛妹妹
    2021-02-01 07:59

    You're missing defining the dependencies correctly I believe (e.g. set "$" to your jquery declaration):

    "plugin": {
      "exports": "plugin",
      "depends": [
        "jquery:$"
      ]
    },...
    

提交回复
热议问题