{"action":"created","issue":{"url":"https://api.github.com/repos/muut/riotjs/issues/472","labels_url":"https://api.github.com/repos/muut/riotjs/issues/472/labels{/name}","comments_url":"https://api.github.com/repos/muut/riotjs/issues/472/comments","events_url":"https://api.github.com/repos/muut/riotjs/issues/472/events","html_url":"https://github.com/muut/riotjs/issues/472","id":59758457,"number":472,"title":"package.json: { \"main\": \"lib/node.js\" }","user":{"login":"mingliangfeng","id":2775574,"avatar_url":"https://avatars.githubusercontent.com/u/2775574?v=3","gravatar_id":"","url":"https://api.github.com/users/mingliangfeng","html_url":"https://github.com/mingliangfeng","followers_url":"https://api.github.com/users/mingliangfeng/followers","following_url":"https://api.github.com/users/mingliangfeng/following{/other_user}","gists_url":"https://api.github.com/users/mingliangfeng/gists{/gist_id}","starred_url":"https://api.github.com/users/mingliangfeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mingliangfeng/subscriptions","organizations_url":"https://api.github.com/users/mingliangfeng/orgs","repos_url":"https://api.github.com/users/mingliangfeng/repos","events_url":"https://api.github.com/users/mingliangfeng/events{/privacy}","received_events_url":"https://api.github.com/users/mingliangfeng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-03-04T07:03:17Z","updated_at":"2015-03-11T03:50:47Z","closed_at":null,"body":"Some nodejs libs simulate 'require' and load relative files according to \"main\" configuration in package.json (e.g. jest). Isn't it good to just put { \"main\": \"riot.js\" } there? as one can always get the compiler by require('riot/compiler'). I am having issues when using jest to test my riot app.\r\n\r\nAnd in lib/node.js, I believe it is better to put the following code snippet to lib/compiler.js:\r\n\r\n    // allow to require('some.tag')\r\n    require.extensions['.tag'] = function(module, filename) {\r\n      var src = riot.compile(require('fs').readFileSync(filename, 'utf8'))\r\n      module._compile(src, filename)\r\n    }\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/muut/riotjs/issues/comments/78200800","html_url":"https://github.com/muut/riotjs/issues/472#issuecomment-78200800","issue_url":"https://api.github.com/repos/muut/riotjs/issues/472","id":78200800,"user":{"login":"tipiirai","id":169330,"avatar_url":"https://avatars.githubusercontent.com/u/169330?v=3","gravatar_id":"","url":"https://api.github.com/users/tipiirai","html_url":"https://github.com/tipiirai","followers_url":"https://api.github.com/users/tipiirai/followers","following_url":"https://api.github.com/users/tipiirai/following{/other_user}","gists_url":"https://api.github.com/users/tipiirai/gists{/gist_id}","starred_url":"https://api.github.com/users/tipiirai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tipiirai/subscriptions","organizations_url":"https://api.github.com/users/tipiirai/orgs","repos_url":"https://api.github.com/users/tipiirai/repos","events_url":"https://api.github.com/users/tipiirai/events{/privacy}","received_events_url":"https://api.github.com/users/tipiirai/received_events","type":"User","site_admin":false},"created_at":"2015-03-11T03:50:47Z","updated_at":"2015-03-11T03:50:47Z","body":"@cognitom @GianlucaGuarini I think separating node compiler from the browser one makes perfect sense. "}}