{"action":"created","issue":{"url":"https://api.github.com/repos/Mottie/tablesorter/issues/829","labels_url":"https://api.github.com/repos/Mottie/tablesorter/issues/829/labels{/name}","comments_url":"https://api.github.com/repos/Mottie/tablesorter/issues/829/comments","events_url":"https://api.github.com/repos/Mottie/tablesorter/issues/829/events","html_url":"https://github.com/Mottie/tablesorter/issues/829","id":58813484,"number":829,"title":"Usage with Require JS","user":{"login":"skoch","id":112034,"avatar_url":"https://avatars.githubusercontent.com/u/112034?v=3","gravatar_id":"","url":"https://api.github.com/users/skoch","html_url":"https://github.com/skoch","followers_url":"https://api.github.com/users/skoch/followers","following_url":"https://api.github.com/users/skoch/following{/other_user}","gists_url":"https://api.github.com/users/skoch/gists{/gist_id}","starred_url":"https://api.github.com/users/skoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skoch/subscriptions","organizations_url":"https://api.github.com/users/skoch/orgs","repos_url":"https://api.github.com/users/skoch/repos","events_url":"https://api.github.com/users/skoch/events{/privacy}","received_events_url":"https://api.github.com/users/skoch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Mottie/tablesorter/labels/How%20To...","name":"How To...","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-24T22:07:46Z","updated_at":"2015-03-13T19:03:11Z","closed_at":"2015-03-13T19:03:11Z","body":"I'm using tablesorter within a project built using require.js and I can get everything to work fine in develop mode however when I attempt to build my project (minimizing JS) I'm consistently getting an error that `addWidget` is not a function. Below are my apps main entry point as well as the build file (with code removed for brevity.)\r\n\r\nHas anyone attempted to build a project using require.js and succeeded?\r\n\r\n**main.js**\r\n```javascript\r\nrequire.config({\r\n  baseUrl: 'js/lib',\r\n  ...\r\n  paths: {\r\n    jquery: 'jquery-1.11.1.min',\r\n    ...\r\n    tablesorter: 'jquery.tablesorter',\r\n    tablesorterWidgets: 'jquery.tablesorter.widgets'\r\n  },\r\n  shim: {\r\n    ...\r\n    tablesorter: ['jquery'],\r\n    tablesorterWidgets: ['jquery']\r\n  }\r\n});\r\n\r\n\r\nrequire(\r\n  [\r\n    ...\r\n    'jquery',\r\n    'tablesorter',\r\n    'tablesorterWidgets'\r\n  ]\r\n  function( $ )\r\n  {...}\r\n);\r\n```\r\n\r\n**build.js**\r\n```javascript\r\n({\r\n  baseUrl: '.',\r\n  paths: {\r\n    jquery: 'lib/jquery-1.11.1.min',\r\n    ...\r\n    tablesorter: 'lib/jquery.tablesorter',\r\n    tablesorterWidgets: 'lib/jquery.tablesorter.widgets'\r\n  },\r\n  name: \"main\",\r\n  out: \"main-built.js\"\r\n})\r\n```\r\n\r\nThe usage from within one of my components uses the following code:\r\n```javascript\r\n$( \"#test-sortable\" ).tablesorter({\r\n  theme : \"bootstrap\",\r\n  widthFixed: true,\r\n  headerTemplate : '{content} {icon}',\r\n  widgets : [ \"uitheme\", \"zebra\" ],\r\n});\r\n```\r\n\r\n**Console error**\r\n```javascript\r\nUncaught TypeError: undefined is not a function\r\n```\r\nAnd the cursor is clearly at `t.addWidget({id:\"uitheme\"...` from the built JS file."},"comment":{"url":"https://api.github.com/repos/Mottie/tablesorter/issues/comments/79257606","html_url":"https://github.com/Mottie/tablesorter/issues/829#issuecomment-79257606","issue_url":"https://api.github.com/repos/Mottie/tablesorter/issues/829","id":79257606,"user":{"login":"skoch","id":112034,"avatar_url":"https://avatars.githubusercontent.com/u/112034?v=3","gravatar_id":"","url":"https://api.github.com/users/skoch","html_url":"https://github.com/skoch","followers_url":"https://api.github.com/users/skoch/followers","following_url":"https://api.github.com/users/skoch/following{/other_user}","gists_url":"https://api.github.com/users/skoch/gists{/gist_id}","starred_url":"https://api.github.com/users/skoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skoch/subscriptions","organizations_url":"https://api.github.com/users/skoch/orgs","repos_url":"https://api.github.com/users/skoch/repos","events_url":"https://api.github.com/users/skoch/events{/privacy}","received_events_url":"https://api.github.com/users/skoch/received_events","type":"User","site_admin":false},"created_at":"2015-03-13T19:03:11Z","updated_at":"2015-03-13T19:03:11Z","body":"@Mottie :+1: \r\n\r\nApologies for not getting back to you sooner but happy to report that v2.21.1 fixes the issue. (Client finally made a decision!)\r\n\r\nMany thanks!"}}