{"action":"created","issue":{"url":"https://api.github.com/repos/duojs/pack/issues/39","labels_url":"https://api.github.com/repos/duojs/pack/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/duojs/pack/issues/39/comments","events_url":"https://api.github.com/repos/duojs/pack/issues/39/events","html_url":"https://github.com/duojs/pack/pull/39","id":64629607,"number":39,"title":"Improving source-maps internally","user":{"login":"dominicbarnes","id":160197,"avatar_url":"https://avatars.githubusercontent.com/u/160197?v=3","gravatar_id":"","url":"https://api.github.com/users/dominicbarnes","html_url":"https://github.com/dominicbarnes","followers_url":"https://api.github.com/users/dominicbarnes/followers","following_url":"https://api.github.com/users/dominicbarnes/following{/other_user}","gists_url":"https://api.github.com/users/dominicbarnes/gists{/gist_id}","starred_url":"https://api.github.com/users/dominicbarnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominicbarnes/subscriptions","organizations_url":"https://api.github.com/users/dominicbarnes/orgs","repos_url":"https://api.github.com/users/dominicbarnes/repos","events_url":"https://api.github.com/users/dominicbarnes/events{/privacy}","received_events_url":"https://api.github.com/users/dominicbarnes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-26T20:49:41Z","updated_at":"2015-03-28T19:19:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/duojs/pack/pulls/39","html_url":"https://github.com/duojs/pack/pull/39","diff_url":"https://github.com/duojs/pack/pull/39.diff","patch_url":"https://github.com/duojs/pack/pull/39.patch"},"body":"This makes a few changes to make dealing with source-maps easier for duo upstream and likely plugin authors and other people using the JS API.\r\n\r\nFirst, when source-maps is set to `inline`, the comment is directly appended to `results.code`. This prevents upstream from needing to care about inline vs external when writing files. It's also what I would expect, since that's what babel does when you set `sourceMap: 'inline'` in their config.\r\n\r\nSecond, when source-maps is set to `true`, (ie: external) then `results.map` is just the string that would be written to `entry.js.map`. This also spares upstream from needing to care about the format of the source maps, if it sees `results.map` it just proceeds and pipes it directly to a file.\r\n\r\nThird, in the context of the previous step, it also appends the appropriate comment to `results.code`. (ie: `//# sourceMappingURL={entry}.map`)\r\n\r\nThese are all breaking changes unfortunately, but I think these are necessary as we try to migrate to the plugin hooks, not to mention improving the interoperability for things like gulp. (lots of this logic is currently in `Duo#write()`, so people using `Duo#run()` have to worry about source-maps all over the place. :("},"comment":{"url":"https://api.github.com/repos/duojs/pack/issues/comments/87287628","html_url":"https://github.com/duojs/pack/pull/39#issuecomment-87287628","issue_url":"https://api.github.com/repos/duojs/pack/issues/39","id":87287628,"user":{"login":"stephenmathieson","id":571265,"avatar_url":"https://avatars.githubusercontent.com/u/571265?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenmathieson","html_url":"https://github.com/stephenmathieson","followers_url":"https://api.github.com/users/stephenmathieson/followers","following_url":"https://api.github.com/users/stephenmathieson/following{/other_user}","gists_url":"https://api.github.com/users/stephenmathieson/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenmathieson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenmathieson/subscriptions","organizations_url":"https://api.github.com/users/stephenmathieson/orgs","repos_url":"https://api.github.com/users/stephenmathieson/repos","events_url":"https://api.github.com/users/stephenmathieson/events{/privacy}","received_events_url":"https://api.github.com/users/stephenmathieson/received_events","type":"User","site_admin":false},"created_at":"2015-03-28T19:19:54Z","updated_at":"2015-03-28T19:19:54Z","body":"@MatthewMueller because we haven't released a `1.x` of duo yet, we can introduce breaking changes without bumping the major... semver makes no sense.  this patch will require a `3.0.0` release of pack though."}}