{"action":"created","issue":{"url":"https://api.github.com/repos/ivogabe/gulp-typescript/issues/121","labels_url":"https://api.github.com/repos/ivogabe/gulp-typescript/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/ivogabe/gulp-typescript/issues/121/comments","events_url":"https://api.github.com/repos/ivogabe/gulp-typescript/issues/121/events","html_url":"https://github.com/ivogabe/gulp-typescript/issues/121","id":76054808,"number":121,"title":"Reference files in definitions referencing wrong location","user":{"login":"designxtek","id":1266739,"avatar_url":"https://avatars.githubusercontent.com/u/1266739?v=3","gravatar_id":"","url":"https://api.github.com/users/designxtek","html_url":"https://github.com/designxtek","followers_url":"https://api.github.com/users/designxtek/followers","following_url":"https://api.github.com/users/designxtek/following{/other_user}","gists_url":"https://api.github.com/users/designxtek/gists{/gist_id}","starred_url":"https://api.github.com/users/designxtek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/designxtek/subscriptions","organizations_url":"https://api.github.com/users/designxtek/orgs","repos_url":"https://api.github.com/users/designxtek/repos","events_url":"https://api.github.com/users/designxtek/events{/privacy}","received_events_url":"https://api.github.com/users/designxtek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-13T16:59:09Z","updated_at":"2015-05-14T07:58:50Z","closed_at":null,"body":"When I run gulp typescript my generated type definition file references the wrong path.\r\n\r\nI have _references.ts with:\r\n`/// <reference path=\"../typings/d3/d3.d.ts\" />`\r\n\r\nWhen the definition is generated for _references.ts to lets say myApp.d.ts it outputs\r\n`/// <reference path=\"typings/d3/d3.d.ts\" />`\r\n\r\nIt doesn't take in the `..` "},"comment":{"url":"https://api.github.com/repos/ivogabe/gulp-typescript/issues/comments/101962628","html_url":"https://github.com/ivogabe/gulp-typescript/issues/121#issuecomment-101962628","issue_url":"https://api.github.com/repos/ivogabe/gulp-typescript/issues/121","id":101962628,"user":{"login":"ivogabe","id":4706418,"avatar_url":"https://avatars.githubusercontent.com/u/4706418?v=3","gravatar_id":"","url":"https://api.github.com/users/ivogabe","html_url":"https://github.com/ivogabe","followers_url":"https://api.github.com/users/ivogabe/followers","following_url":"https://api.github.com/users/ivogabe/following{/other_user}","gists_url":"https://api.github.com/users/ivogabe/gists{/gist_id}","starred_url":"https://api.github.com/users/ivogabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivogabe/subscriptions","organizations_url":"https://api.github.com/users/ivogabe/orgs","repos_url":"https://api.github.com/users/ivogabe/repos","events_url":"https://api.github.com/users/ivogabe/events{/privacy}","received_events_url":"https://api.github.com/users/ivogabe/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T07:58:50Z","updated_at":"2015-05-14T07:58:50Z","body":"This is because of the way how TypeScript handles paths. TypeScript doesn't know of the `gulp.dest` call, so it can't write the right relative paths, it expects that the files will be written under `src`. You can solve it by changing your gulp file to:\r\n```javascript\r\ngulp.task('compileCommonTS', function() {\r\n\tvar tsResult = gulp.src(tsProject.common.reference)\r\n\t\t\t\t\t\t.pipe(ts({ out: paths.common + tsProject.common.js, target: 'ES5', declaration: true }));\t\r\n\t// \"paths.common + tsProject.common.js\" instead of \"tsProject.common.js\"\t\t\t\r\n\treturn merge([\r\n        tsResult.dts.pipe(gulp.dest('./')),\r\n        tsResult.js.pipe(gulp.dest('./'))\r\n    ]);\r\n});\r\n```"}}