{"action":"closed","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/477","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/477/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/477/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/477/events","html_url":"https://github.com/systemjs/systemjs/issues/477","id":84551903,"number":477,"title":"Issue with loading none TypeScript modules from a TypeScript module","user":{"login":"subesokun","id":6920421,"avatar_url":"https://avatars.githubusercontent.com/u/6920421?v=3","gravatar_id":"","url":"https://api.github.com/users/subesokun","html_url":"https://github.com/subesokun","followers_url":"https://api.github.com/users/subesokun/followers","following_url":"https://api.github.com/users/subesokun/following{/other_user}","gists_url":"https://api.github.com/users/subesokun/gists{/gist_id}","starred_url":"https://api.github.com/users/subesokun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subesokun/subscriptions","organizations_url":"https://api.github.com/users/subesokun/orgs","repos_url":"https://api.github.com/users/subesokun/repos","events_url":"https://api.github.com/users/subesokun/events{/privacy}","received_events_url":"https://api.github.com/users/subesokun/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/systemjs/systemjs/labels/support","name":"support","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-03T13:00:56Z","updated_at":"2015-06-09T14:17:06Z","closed_at":"2015-06-09T14:17:06Z","body":"While playing around with TypeScript I came across a tricky use-case (using `plugin-typescript` from @frankwallis)\r\n\r\n```typescript\r\n/* lib/main.ts */\r\n/// <reference path=\"../typings/somemod/somemod.d.ts\" />\r\nimport 'somemod/somemod';\r\n```\r\n```typescript\r\n/* typings/somemod/somemod.d.ts */\r\ndeclare module \"somemod/somemod\" { }\r\n```\r\nNormally everything would work as expected in case the `somemod` package contains a file named `somemod.ts` but in case the module ships e.g. only transpiled cjs files you run into the issue that `import 'somemod/somemod'` should load the file `somemod.js` instead of the `somemod.ts` file.\r\n\r\nJust writing `import 'somemod'` would solve that issue as then somehow the cjs loader gets used instead of the typescript loader but then the TS compiler will throw an error as it can't find the external module definition for `somemod` :( Writing `import 'somemod/somemod.js'` won't work either as this will also raise the same TS compiler error. Sadly the definition file is not under my control so I can't change it to `declare module \"somemod\"`.\r\n\r\nWhat confuses me a little bit is that `import 'somemod'` will use the cjs loader but `import 'somemod/somemod'` will use the typescript loader to fetch the file.\r\n\r\nAny ideas? Maybe this issue is somewhat related to #319\r\n\r\n(using SystemJS that comes along with jspm@0.15.6)"}}