Search code examples
pluginsrequirejsamdbower

Using bower with plugins that need AMD


I have a trying to use Bower.io with my RequireJS AMD project but I'm pretty new to it. I have a plugin in my bower.json file thats like

"jquery-ui-touch-punch": "https://github.com/furf/jquery-ui-touch-punch.git",

but the problem is that this file is not wrapped in AMD - so it errors. I can manually edit the file to wrap it - but that makes no sense for the purposes of using bower. Is there some resource I can use or a way I can make this wrap inside requireJS ?


Solution

  • shim: Configure the dependencies, exports, and custom initialization for older, traditional "browser globals" scripts that do not use define() to declare the dependencies and set a module value.

    http://requirejs.org/docs/api.html#config-shim