{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/builder/issues/226","labels_url":"https://api.github.com/repos/systemjs/builder/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/builder/issues/226/comments","events_url":"https://api.github.com/repos/systemjs/builder/issues/226/events","html_url":"https://github.com/systemjs/builder/issues/226","id":94405215,"number":226,"title":"Invidiual module pre-compilation API","user":{"login":"nflavour","id":8509252,"avatar_url":"https://avatars.githubusercontent.com/u/8509252?v=3","gravatar_id":"","url":"https://api.github.com/users/nflavour","html_url":"https://github.com/nflavour","followers_url":"https://api.github.com/users/nflavour/followers","following_url":"https://api.github.com/users/nflavour/following{/other_user}","gists_url":"https://api.github.com/users/nflavour/gists{/gist_id}","starred_url":"https://api.github.com/users/nflavour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nflavour/subscriptions","organizations_url":"https://api.github.com/users/nflavour/orgs","repos_url":"https://api.github.com/users/nflavour/repos","events_url":"https://api.github.com/users/nflavour/events{/privacy}","received_events_url":"https://api.github.com/users/nflavour/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/systemjs/builder/labels/feature","name":"feature","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-10T22:26:05Z","updated_at":"2015-07-21T13:53:05Z","closed_at":null,"body":"I'm working on a project that requires me to use `csp` version of `system.js`, so I have to send to the client pre-compiled files. Another requirement is that I'm trying to optimize for `HTTP/2`, so I would like to compile each module/file individually and not bundle them. ESM can be done easily with babel or even with `builder.trace(filename)`, but CommonJS files are not as easy.\r\n\r\nI've tried to use `builder.trace(filename)` but what it returned is not compiled to system. I tried `builder.build(filename)` but it bundles the files.\r\n\r\nWhat's the best way to pre-compiled CommonJS files individually, and load them into the browser?\r\n\r\nThanks in advance for your help!"},"comment":{"url":"https://api.github.com/repos/systemjs/builder/issues/comments/123313896","html_url":"https://github.com/systemjs/builder/issues/226#issuecomment-123313896","issue_url":"https://api.github.com/repos/systemjs/builder/issues/226","id":123313896,"user":{"login":"guybedford","id":598730,"avatar_url":"https://avatars.githubusercontent.com/u/598730?v=3","gravatar_id":"","url":"https://api.github.com/users/guybedford","html_url":"https://github.com/guybedford","followers_url":"https://api.github.com/users/guybedford/followers","following_url":"https://api.github.com/users/guybedford/following{/other_user}","gists_url":"https://api.github.com/users/guybedford/gists{/gist_id}","starred_url":"https://api.github.com/users/guybedford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guybedford/subscriptions","organizations_url":"https://api.github.com/users/guybedford/orgs","repos_url":"https://api.github.com/users/guybedford/repos","events_url":"https://api.github.com/users/guybedford/events{/privacy}","received_events_url":"https://api.github.com/users/guybedford/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T13:53:05Z","updated_at":"2015-07-21T13:53:05Z","body":"If you can manually construct a `load` record just like the traced load records, you could pass that directly to the private API - https://github.com/systemjs/builder/blob/master/lib/compile.js#L43. Ideally we would have this optimization in the arithmetic though."}}