{"action":"created","issue":{"url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/214","repository_url":"https://api.github.com/repos/TypeStrong/ts-loader","labels_url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/214/labels{/name}","comments_url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/214/comments","events_url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/214/events","html_url":"https://github.com/TypeStrong/ts-loader/pull/214","id":157193855,"number":214,"title":"Use a relative path for the declaration assets","user":{"login":"17cupsofcoffee","id":784533,"avatar_url":"https://avatars.githubusercontent.com/u/784533?v=3","gravatar_id":"","url":"https://api.github.com/users/17cupsofcoffee","html_url":"https://github.com/17cupsofcoffee","followers_url":"https://api.github.com/users/17cupsofcoffee/followers","following_url":"https://api.github.com/users/17cupsofcoffee/following{/other_user}","gists_url":"https://api.github.com/users/17cupsofcoffee/gists{/gist_id}","starred_url":"https://api.github.com/users/17cupsofcoffee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/17cupsofcoffee/subscriptions","organizations_url":"https://api.github.com/users/17cupsofcoffee/orgs","repos_url":"https://api.github.com/users/17cupsofcoffee/repos","events_url":"https://api.github.com/users/17cupsofcoffee/events{/privacy}","received_events_url":"https://api.github.com/users/17cupsofcoffee/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-05-27T12:16:14Z","updated_at":"2016-10-11T13:13:17Z","closed_at":"2016-10-06T16:26:51Z","pull_request":{"url":"https://api.github.com/repos/TypeStrong/ts-loader/pulls/214","html_url":"https://github.com/TypeStrong/ts-loader/pull/214","diff_url":"https://github.com/TypeStrong/ts-loader/pull/214.diff","patch_url":"https://github.com/TypeStrong/ts-loader/pull/214.patch"},"body":"This is intended as a fix for issue #185 - a full explanation of what the problem was can be found in [this comment](https://github.com/TypeStrong/ts-loader/issues/185#issuecomment-222118959), but what it boiled down to is that the language service returns absolute paths for generated declaration files, and these were being used directly as keys in `compilation.assets`, causing Webpack to hang during the emit stage. Resolving the path relative to the current working directory beforehand fixes this issue. According to @t246246's comment on the issue, this only affects Windows, but as I don't have access to a Linux or OSX device, I can't confirm that.\r\n\r\nOne caveat to this fix is that the output file structure for the declaration files follows that of the source code - i.e, if the source looks like this:\r\n\r\n```\r\nroot/\r\n    src/\r\n        dir1/\r\n        dir2/\r\n```\r\n\r\nThen the declarations get output like so:\r\n\r\n```\r\nroot/\r\n    dist/\r\n        src/\r\n            dir1/\r\n            dir2/\r\n    src/\r\n        dir1/\r\n        dir2/\r\n```\r\n\r\nThis might well be a breaking change or not be the 'correct' way of handling it - I can't tell, as this functionality never worked for me in the first place! There's a [currently pending pull request](https://github.com/s-panferov/awesome-typescript-loader/pull/136) on awesome-typescript-loader's repository that demonstrates a possible way of making it follow Webpack's context instead - if the current way files are output isn't acceptable, I can have a go at implementing something along those lines here instead? Let me know, I can make some more changes if needed. This should be a good start though, at the very least."},"comment":{"url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/comments/252912591","html_url":"https://github.com/TypeStrong/ts-loader/pull/214#issuecomment-252912591","issue_url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/214","id":252912591,"user":{"login":"johnnyreilly","id":1010525,"avatar_url":"https://avatars.githubusercontent.com/u/1010525?v=3","gravatar_id":"","url":"https://api.github.com/users/johnnyreilly","html_url":"https://github.com/johnnyreilly","followers_url":"https://api.github.com/users/johnnyreilly/followers","following_url":"https://api.github.com/users/johnnyreilly/following{/other_user}","gists_url":"https://api.github.com/users/johnnyreilly/gists{/gist_id}","starred_url":"https://api.github.com/users/johnnyreilly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnnyreilly/subscriptions","organizations_url":"https://api.github.com/users/johnnyreilly/orgs","repos_url":"https://api.github.com/users/johnnyreilly/repos","events_url":"https://api.github.com/users/johnnyreilly/events{/privacy}","received_events_url":"https://api.github.com/users/johnnyreilly/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T13:13:17Z","updated_at":"2016-10-11T13:13:17Z","body":"Hi @dizel3d,\r\n\r\nThanks for reporting; PRs to improve the behaviour would be gratefully received.  Over to you 👍 "}}
{"actor":{"display_login":"johnnyreilly"}}