require cdn libraries in browserify without bundling it in the final js file require cdn libraries in browserify without bundling it in the final js file node.js node.js

require cdn libraries in browserify without bundling it in the final js file


With browserify-shim you can add this in your package.json file:

  "browserify": {    "transform": [      "browserify-shim"    ]  },  "browserify-shim": {    "jquery": "global:$"  }

Then jquery will be available in your modules via require('jquery')


If you load jQuery before the Browserify bundle on the page, $ will be available as a global.