{"action":"created","issue":{"url":"https://api.github.com/repos/substack/node-browserify/issues/901","labels_url":"https://api.github.com/repos/substack/node-browserify/issues/901/labels{/name}","comments_url":"https://api.github.com/repos/substack/node-browserify/issues/901/comments","events_url":"https://api.github.com/repos/substack/node-browserify/issues/901/events","html_url":"https://github.com/substack/node-browserify/issues/901","id":42861444,"number":901,"title":"Gracefully handle files that cannot be required","user":{"login":"cvan","id":203725,"avatar_url":"https://avatars.githubusercontent.com/u/203725?v=3","gravatar_id":"","url":"https://api.github.com/users/cvan","html_url":"https://github.com/cvan","followers_url":"https://api.github.com/users/cvan/followers","following_url":"https://api.github.com/users/cvan/following{/other_user}","gists_url":"https://api.github.com/users/cvan/gists{/gist_id}","starred_url":"https://api.github.com/users/cvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvan/subscriptions","organizations_url":"https://api.github.com/users/cvan/orgs","repos_url":"https://api.github.com/users/cvan/repos","events_url":"https://api.github.com/users/cvan/events{/privacy}","received_events_url":"https://api.github.com/users/cvan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-09-16T09:30:31Z","updated_at":"2015-04-17T04:07:55Z","closed_at":null,"body":"I have a file (`settings.js`) that is compiled by browserify. I want it to require a `settings_local.js` file only if if it exists. From the documentation and source code, I can't figure out if this is possible. This is what I currently have:\r\n\r\n```js\r\nvar settings_local = {};\r\ntry {\r\n  settings_local = require('./settings_local.js');\r\n} catch (e) {\r\n}\r\n```\r\n\r\nThis is the error I get:\r\n\r\n```bash\r\nevents.js:82\r\n      throw er; // Unhandled 'error' event\r\n            ^\r\nError: Cannot find module './settings_local.js' from '/opt/galaxy.js-mobile-gamepad/src/js'\r\n    at /opt/galaxy.js-mobile-gamepad/node_modules/browserify/node_modules/resolve/lib/async.js:42:25\r\n    at load (/opt/galaxy.js-mobile-gamepad/node_modules/browserify/node_modules/resolve/lib/async.js:60:43)\r\n    at /opt/galaxy.js-mobile-gamepad/node_modules/browserify/node_modules/resolve/lib/async.js:66:22\r\n    at /opt/galaxy.js-mobile-gamepad/node_modules/browserify/node_modules/resolve/lib/async.js:21:47\r\n    at Object.oncomplete (fs.js:97:15)\r\n```"},"comment":{"url":"https://api.github.com/repos/substack/node-browserify/issues/comments/93889090","html_url":"https://github.com/substack/node-browserify/issues/901#issuecomment-93889090","issue_url":"https://api.github.com/repos/substack/node-browserify/issues/901","id":93889090,"user":{"login":"terinjokes","id":273509,"avatar_url":"https://avatars.githubusercontent.com/u/273509?v=3","gravatar_id":"","url":"https://api.github.com/users/terinjokes","html_url":"https://github.com/terinjokes","followers_url":"https://api.github.com/users/terinjokes/followers","following_url":"https://api.github.com/users/terinjokes/following{/other_user}","gists_url":"https://api.github.com/users/terinjokes/gists{/gist_id}","starred_url":"https://api.github.com/users/terinjokes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terinjokes/subscriptions","organizations_url":"https://api.github.com/users/terinjokes/orgs","repos_url":"https://api.github.com/users/terinjokes/repos","events_url":"https://api.github.com/users/terinjokes/events{/privacy}","received_events_url":"https://api.github.com/users/terinjokes/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T04:07:55Z","updated_at":"2015-04-17T04:07:55Z","body":"Based on how browserify works, I don't think it is possible. Can you resolve the use cases by using the `envify` transform to allow settings to be overridden locally?"}}