{"action":"created","issue":{"url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/128","labels_url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/128/comments","events_url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/128/events","html_url":"https://github.com/tavendo/AutobahnJS/issues/128","id":59049317,"number":128,"title":"Grunt doesn't like require(\"../package.json\")","user":{"login":"kilianm","id":197475,"avatar_url":"https://avatars.githubusercontent.com/u/197475?v=3","gravatar_id":"","url":"https://api.github.com/users/kilianm","html_url":"https://github.com/kilianm","followers_url":"https://api.github.com/users/kilianm/followers","following_url":"https://api.github.com/users/kilianm/following{/other_user}","gists_url":"https://api.github.com/users/kilianm/gists{/gist_id}","starred_url":"https://api.github.com/users/kilianm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kilianm/subscriptions","organizations_url":"https://api.github.com/users/kilianm/orgs","repos_url":"https://api.github.com/users/kilianm/repos","events_url":"https://api.github.com/users/kilianm/events{/privacy}","received_events_url":"https://api.github.com/users/kilianm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-26T10:10:27Z","updated_at":"2015-06-30T00:24:53Z","closed_at":"2015-02-27T09:49:19Z","body":"Inside a grunt+webpack based project I'm having issues building autobahnJS.\r\nThe follow error occurs:\r\n<pre>\r\nModule parse failed: /home/kilian/workspace/some-project/node_modules/autobahn/package.json Line 2: Unexpected token :\r\nYou may need an appropriate loader to handle this file type.\r\n| {\r\n|   \"name\": \"autobahn\",\r\n|   \"version\": \"0.9.5\",\r\n|   \"description\": \"An implementation of The Web Application Messaging Protocol (WAMP).\",\r\n @ ./~/autobahn/lib/autobahn.js 3:12-38\r\n</pre>\r\n\r\nIt seems that lib/autobahn.js uses require() to load a JSON file (for version information).\r\nLocation:\r\nhttps://github.com/tavendo/AutobahnJS/blob/master/package/lib/autobahn.js#L17\r\n\r\nI think requirejs can only load json appropriately using the text! and json! plugin (e.g. https://github.com/millermedeiros/requirejs-plugins )."},"comment":{"url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/comments/116886265","html_url":"https://github.com/tavendo/AutobahnJS/issues/128#issuecomment-116886265","issue_url":"https://api.github.com/repos/tavendo/AutobahnJS/issues/128","id":116886265,"user":{"login":"azazel75","id":834719,"avatar_url":"https://avatars.githubusercontent.com/u/834719?v=3","gravatar_id":"","url":"https://api.github.com/users/azazel75","html_url":"https://github.com/azazel75","followers_url":"https://api.github.com/users/azazel75/followers","following_url":"https://api.github.com/users/azazel75/following{/other_user}","gists_url":"https://api.github.com/users/azazel75/gists{/gist_id}","starred_url":"https://api.github.com/users/azazel75/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azazel75/subscriptions","organizations_url":"https://api.github.com/users/azazel75/orgs","repos_url":"https://api.github.com/users/azazel75/repos","events_url":"https://api.github.com/users/azazel75/events{/privacy}","received_events_url":"https://api.github.com/users/azazel75/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T00:24:53Z","updated_at":"2015-06-30T00:24:53Z","body":"@kilianm, @oberstet Browserify sucks a bit, so i looked into this and found a solution: \r\n\r\n* install autobahn and json-loader wih npm\r\n* inside webpack.config.js add something like:\r\n\r\nmodule: {\r\n        loaders: [\r\n            { test: /autobahn\\/package\\.json$/,\r\n              loader: 'json-loader'}\r\n        ]\r\n    },\r\n\r\n* forget browserify"}}