{"action":"created","issue":{"url":"https://api.github.com/repos/firmata/firmata.js/issues/117","repository_url":"https://api.github.com/repos/firmata/firmata.js","labels_url":"https://api.github.com/repos/firmata/firmata.js/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/firmata/firmata.js/issues/117/comments","events_url":"https://api.github.com/repos/firmata/firmata.js/issues/117/events","html_url":"https://github.com/firmata/firmata.js/issues/117","id":144397671,"number":117,"title":"Browserify support","user":{"login":"bcjordan","id":206973,"avatar_url":"https://avatars.githubusercontent.com/u/206973?v=3","gravatar_id":"","url":"https://api.github.com/users/bcjordan","html_url":"https://github.com/bcjordan","followers_url":"https://api.github.com/users/bcjordan/followers","following_url":"https://api.github.com/users/bcjordan/following{/other_user}","gists_url":"https://api.github.com/users/bcjordan/gists{/gist_id}","starred_url":"https://api.github.com/users/bcjordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcjordan/subscriptions","organizations_url":"https://api.github.com/users/bcjordan/orgs","repos_url":"https://api.github.com/users/bcjordan/repos","events_url":"https://api.github.com/users/bcjordan/events{/privacy}","received_events_url":"https://api.github.com/users/bcjordan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-29T21:43:04Z","updated_at":"2016-03-29T21:45:32Z","closed_at":null,"body":"Firmata currently fails to browserify because the `test/` directory is `.npmignore`d, but `test/MockSerialPort` gets conditionally `require()`d conditionally based on `global.IS_TEST_MODE`, resulting in the error:\r\n\r\n`Error: Cannot find module '../test/MockSerialPort' from '/Users/brian/code/firmata-browserify/node_modules/firmata/lib'`\r\n\r\nafter running browserify.\r\n\r\n# Minimal repro repository\r\n\r\nhttps://github.com/bcjordan/firmata-browserify-test\r\n\r\n* `git clone https://github.com/bcjordan/firmata-browserify-test.git`\r\n* `cd firmata-browserify-test`\r\n* `npm run build`\r\n\r\nExpected: browserify runs OK, maybe either including `MockFirmata` or requiring `MockFirmata` to be passed in by the tests?\r\nActual: \r\n\r\n```\r\nnpm run build\r\n\r\n> firmata-browserify@1.0.0 build /Users/brian/code/firmata-browserify\r\n> browserify main.js -o bundle.js\r\n\r\nError: Cannot find module '../test/MockSerialPort' from '/Users/brian/code/firmata-browserify/node_modules/firmata/lib'\r\n    at /usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:55:21\r\n    at load (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)\r\n    at onex (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)\r\n    at /usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:22:47\r\n    at FSReqWrap.oncomplete (fs.js:95:15)\r\n```"},"comment":{"url":"https://api.github.com/repos/firmata/firmata.js/issues/comments/203125291","html_url":"https://github.com/firmata/firmata.js/issues/117#issuecomment-203125291","issue_url":"https://api.github.com/repos/firmata/firmata.js/issues/117","id":203125291,"user":{"login":"monteslu","id":423800,"avatar_url":"https://avatars.githubusercontent.com/u/423800?v=3","gravatar_id":"","url":"https://api.github.com/users/monteslu","html_url":"https://github.com/monteslu","followers_url":"https://api.github.com/users/monteslu/followers","following_url":"https://api.github.com/users/monteslu/following{/other_user}","gists_url":"https://api.github.com/users/monteslu/gists{/gist_id}","starred_url":"https://api.github.com/users/monteslu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monteslu/subscriptions","organizations_url":"https://api.github.com/users/monteslu/orgs","repos_url":"https://api.github.com/users/monteslu/repos","events_url":"https://api.github.com/users/monteslu/events{/privacy}","received_events_url":"https://api.github.com/users/monteslu/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T21:45:32Z","updated_at":"2016-03-29T21:45:32Z","body":"It's also an issue when trying to use webpack."}}