{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/builder/issues/383","labels_url":"https://api.github.com/repos/systemjs/builder/issues/383/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/builder/issues/383/comments","events_url":"https://api.github.com/repos/systemjs/builder/issues/383/events","html_url":"https://github.com/systemjs/builder/issues/383","id":114637007,"number":383,"title":"Bundling a reusable library","user":{"login":"nukefusion","id":2394420,"avatar_url":"https://avatars.githubusercontent.com/u/2394420?v=3","gravatar_id":"","url":"https://api.github.com/users/nukefusion","html_url":"https://github.com/nukefusion","followers_url":"https://api.github.com/users/nukefusion/followers","following_url":"https://api.github.com/users/nukefusion/following{/other_user}","gists_url":"https://api.github.com/users/nukefusion/gists{/gist_id}","starred_url":"https://api.github.com/users/nukefusion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nukefusion/subscriptions","organizations_url":"https://api.github.com/users/nukefusion/orgs","repos_url":"https://api.github.com/users/nukefusion/repos","events_url":"https://api.github.com/users/nukefusion/events{/privacy}","received_events_url":"https://api.github.com/users/nukefusion/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-02T16:56:54Z","updated_at":"2015-11-02T19:37:09Z","closed_at":null,"body":"I'm having a real hard time understanding how to package a simple library that I can reuse with jspm. How do I bundle a reusable library whilst only exposing the modules I want, without module ID clashes? \r\n\r\nI have an entry point file, index.js:\r\n\r\n    export { Class1 } from \"./Classes/Class1\";\r\n\r\nWhen I build it I end up with:\r\n\r\n    System.register(\"Classes/Class2.js\", [], function(exports_1) {\r\n    });\r\n\r\n    System.register(\"Classes/Class1.js\", [\"Classes/Class2.js\"], function(exports_1) {\r\n    });\r\n\r\n    System.register(\"Index.js\", [\"Classes/Class1.js\"], function(exports_1) {\r\n    });\r\n\r\nIt seems to me that anyone could ```require``` class2, even though it's just a dependency of class1 and not exposed via my entry point module. What I really want in terms of output is a single module that just exports ```Class1```.\r\n\r\nAlso, how do I prefix these module paths with some sort of unique package ID? What if another 3rd party package defines ```Classes/Class1.js```"},"comment":{"url":"https://api.github.com/repos/systemjs/builder/issues/comments/153134778","html_url":"https://github.com/systemjs/builder/issues/383#issuecomment-153134778","issue_url":"https://api.github.com/repos/systemjs/builder/issues/383","id":153134778,"user":{"login":"nukefusion","id":2394420,"avatar_url":"https://avatars.githubusercontent.com/u/2394420?v=3","gravatar_id":"","url":"https://api.github.com/users/nukefusion","html_url":"https://github.com/nukefusion","followers_url":"https://api.github.com/users/nukefusion/followers","following_url":"https://api.github.com/users/nukefusion/following{/other_user}","gists_url":"https://api.github.com/users/nukefusion/gists{/gist_id}","starred_url":"https://api.github.com/users/nukefusion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nukefusion/subscriptions","organizations_url":"https://api.github.com/users/nukefusion/orgs","repos_url":"https://api.github.com/users/nukefusion/repos","events_url":"https://api.github.com/users/nukefusion/events{/privacy}","received_events_url":"https://api.github.com/users/nukefusion/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T19:37:09Z","updated_at":"2015-11-02T19:37:09Z","body":"Thanks Guy, I think I must be misunderstanding something. That does give me a single module and desirably encapsulates my private modules, however it also adds 450-odd lines of module resolution logic in an IIFE at the start of the output which seems superfluous for my needs as I will be using jspm/systemjs to import this module into other projects anyway.\r\n\r\nIf I create many reusable libraries in this way wouldn't that same logic get injected at the start of each library? If I'm using systemjs to import all of these libraries into another project doesn't this approach mean an awful lot of bloat"}}