{"action":"created","issue":{"url":"https://api.github.com/repos/substack/node-browserify/issues/1197","labels_url":"https://api.github.com/repos/substack/node-browserify/issues/1197/labels{/name}","comments_url":"https://api.github.com/repos/substack/node-browserify/issues/1197/comments","events_url":"https://api.github.com/repos/substack/node-browserify/issues/1197/events","html_url":"https://github.com/substack/node-browserify/issues/1197","id":66477435,"number":1197,"title":"Requiring standalone bundle generated by browserify --s within browserify project","user":{"login":"iamcdonald","id":5514263,"avatar_url":"https://avatars.githubusercontent.com/u/5514263?v=3","gravatar_id":"","url":"https://api.github.com/users/iamcdonald","html_url":"https://github.com/iamcdonald","followers_url":"https://api.github.com/users/iamcdonald/followers","following_url":"https://api.github.com/users/iamcdonald/following{/other_user}","gists_url":"https://api.github.com/users/iamcdonald/gists{/gist_id}","starred_url":"https://api.github.com/users/iamcdonald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamcdonald/subscriptions","organizations_url":"https://api.github.com/users/iamcdonald/orgs","repos_url":"https://api.github.com/users/iamcdonald/repos","events_url":"https://api.github.com/users/iamcdonald/events{/privacy}","received_events_url":"https://api.github.com/users/iamcdonald/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-05T20:06:08Z","updated_at":"2015-04-06T12:52:33Z","closed_at":"2015-04-06T12:52:33Z","body":"So, I've created a library that I decided to package up using browserify --s in order to create a UMD shimmed module and all is good.\r\n\r\nHowever, while the shim allows it to be loaded in a bunch of different scenarios (CommonJS, AMD, Window) it appears it cannot be consumed within another browserify project.\r\n\r\nMy hunch is that running browserify simply follows requires all the way down when bundling rather than taking into account the nesting 'require' contexts that seems to be handled by the https://github.com/substack/browser-pack/blob/master/prelude.js in the generated library bundle. Thus when it get's inside the library it looks for files required inside it and expects them to be within the consuming project due to the path provided.\r\n\r\nI guess I'm wondering if this is a bug or if I'm doing something wrong?\r\nAny pointers would be appreciated, thanks."},"comment":{"url":"https://api.github.com/repos/substack/node-browserify/issues/comments/90051188","html_url":"https://github.com/substack/node-browserify/issues/1197#issuecomment-90051188","issue_url":"https://api.github.com/repos/substack/node-browserify/issues/1197","id":90051188,"user":{"login":"jmm","id":129203,"avatar_url":"https://avatars.githubusercontent.com/u/129203?v=3","gravatar_id":"","url":"https://api.github.com/users/jmm","html_url":"https://github.com/jmm","followers_url":"https://api.github.com/users/jmm/followers","following_url":"https://api.github.com/users/jmm/following{/other_user}","gists_url":"https://api.github.com/users/jmm/gists{/gist_id}","starred_url":"https://api.github.com/users/jmm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmm/subscriptions","organizations_url":"https://api.github.com/users/jmm/orgs","repos_url":"https://api.github.com/users/jmm/repos","events_url":"https://api.github.com/users/jmm/events{/privacy}","received_events_url":"https://api.github.com/users/jmm/received_events","type":"User","site_admin":false},"created_at":"2015-04-06T12:52:33Z","updated_at":"2015-04-06T12:52:33Z","body":"@iamcdonald Thanks for the report. You're not doing anything wrong. This is a known issue that's being discussed in https://github.com/substack/node-browserify/pull/1151. I also list current workarounds there. For the purpose of distributing a browserified library that you wish to be consumable by browserify, currently you should run it through derequire or minify it. I'm closing this issue since it's already being discussed in #1151, so feel free to contribute feedback there."}}