{"action":"created","issue":{"url":"https://api.github.com/repos/SitePen/remap-istanbul/issues/25","labels_url":"https://api.github.com/repos/SitePen/remap-istanbul/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/SitePen/remap-istanbul/issues/25/comments","events_url":"https://api.github.com/repos/SitePen/remap-istanbul/issues/25/events","html_url":"https://github.com/SitePen/remap-istanbul/issues/25","id":120196009,"number":25,"title":"Gulp: No such file or directory","user":{"login":"ghpabs","id":3250667,"avatar_url":"https://avatars.githubusercontent.com/u/3250667?v=3","gravatar_id":"","url":"https://api.github.com/users/ghpabs","html_url":"https://github.com/ghpabs","followers_url":"https://api.github.com/users/ghpabs/followers","following_url":"https://api.github.com/users/ghpabs/following{/other_user}","gists_url":"https://api.github.com/users/ghpabs/gists{/gist_id}","starred_url":"https://api.github.com/users/ghpabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghpabs/subscriptions","organizations_url":"https://api.github.com/users/ghpabs/orgs","repos_url":"https://api.github.com/users/ghpabs/repos","events_url":"https://api.github.com/users/ghpabs/events{/privacy}","received_events_url":"https://api.github.com/users/ghpabs/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-03T15:26:01Z","updated_at":"2015-12-04T14:37:42Z","closed_at":"2015-12-03T18:46:16Z","body":"I'm running `remap-instanbul` via Gulp with the configuration below:\r\n\r\n**Gulp tasks**\r\n```js\r\ngulp.task('remap-istanbul', function () {\r\n    return gulp.src('coverage/json/coverage-js.json')\r\n        .pipe(remapIstanbul({\r\n            reports: {\r\n                json: 'coverage/json/coverage-ts.json',\r\n                html: 'coverage/html-report'\r\n            }\r\n        }));\r\n});\r\n```\r\n\r\nThis is how I transpile my TypeScript to JavaScript. Note that I move the transpiled code to `/build` folder.\r\n\r\n```js\r\ngulp.task('ts', function() {\r\n\tvar tsResult = gulp.src('src/**/*.ts')\r\n\t\t.pipe(plugins.sourcemaps.init())\r\n\t\t.pipe(plugins.typescript(tsProject));\r\n\r\n\treturn tsResult\r\n\t\t.js\r\n\t\t.pipe(plugins.sourcemaps.write())\r\n\t\t.pipe(gulp.dest('build/js'));\r\n});\r\n```\r\n\r\nFor some reason the plugin changes my working directory to **`C:\\source`** which isn't correct. The correct directory structure should be something like: `C:\\myproject\\src\\app\\main.ts`.\r\n\r\n**Console**\r\n\r\n```\r\n[15:20:24] Starting 'remap-istanbul'...\r\nfs.js:549\r\n  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);\r\n                 ^\r\n\r\nError: ENOENT: no such file or directory, open 'C:\\source\\app\\main.ts'\r\n    at Error (native)\r\n    at Object.fs.openSync (fs.js:549:18)\r\n    at Object.fs.readFileSync (fs.js:397:15)\r\n    at LookupStore.Store.mix.get (C:\\agent-ui\\SCP_WD_MCA_UI_Seed\\node_modules\\remap-istanbul\\node_modules\\istanbul\\lib\\store\\fslookup.js:40:19)\r\n```\r\n\r\nAm I missing something?"},"comment":{"url":"https://api.github.com/repos/SitePen/remap-istanbul/issues/comments/161982004","html_url":"https://github.com/SitePen/remap-istanbul/issues/25#issuecomment-161982004","issue_url":"https://api.github.com/repos/SitePen/remap-istanbul/issues/25","id":161982004,"user":{"login":"ghpabs","id":3250667,"avatar_url":"https://avatars.githubusercontent.com/u/3250667?v=3","gravatar_id":"","url":"https://api.github.com/users/ghpabs","html_url":"https://github.com/ghpabs","followers_url":"https://api.github.com/users/ghpabs/followers","following_url":"https://api.github.com/users/ghpabs/following{/other_user}","gists_url":"https://api.github.com/users/ghpabs/gists{/gist_id}","starred_url":"https://api.github.com/users/ghpabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghpabs/subscriptions","organizations_url":"https://api.github.com/users/ghpabs/orgs","repos_url":"https://api.github.com/users/ghpabs/repos","events_url":"https://api.github.com/users/ghpabs/events{/privacy}","received_events_url":"https://api.github.com/users/ghpabs/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T14:37:42Z","updated_at":"2015-12-04T14:37:42Z","body":"**Update** \r\n\r\nI fixed it by adding `sourceRoot` when transpiling the TypeScript.\r\n\r\n```\r\nfunction ts() {\r\n\tvar tsResult = gulp.src('src/**/*.ts')\r\n\t\t.pipe(plugins.sourcemaps.init())\r\n\t\t.pipe(plugins.typescript(tsProject));\r\n\r\n\treturn tsResult\r\n\t\t.js\r\n\t\t.pipe(plugins.sourcemaps.write('./', {\r\n\t\t\tsourceRoot: __dirname + '/src'\r\n\t\t}))\r\n\t\t.pipe(gulp.dest('build/js'));\r\n}\r\n```"}}