Title: Discovering .ts files under node_modules resulting in them being compiled · Issue #6964 · microsoft/TypeScript · GitHub
Open Graph Title: Discovering .ts files under node_modules resulting in them being compiled · Issue #6964 · microsoft/TypeScript
X Title: Discovering .ts files under node_modules resulting in them being compiled · Issue #6964 · microsoft/TypeScript
Description: I uncovered this general issue while testing loading JavaScript files from node_modules, but realized (and confirmed) this applies to TypeScript files also. Basically, when we search the node_modules folder, we look for all supported ext...
Open Graph Description: I uncovered this general issue while testing loading JavaScript files from node_modules, but realized (and confirmed) this applies to TypeScript files also. Basically, when we search the node_modul...
X Description: I uncovered this general issue while testing loading JavaScript files from node_modules, but realized (and confirmed) this applies to TypeScript files also. Basically, when we search the node_modul...
Mail addresses
notifications@github.com
Opengraph URL: https://github.com/microsoft/TypeScript/issues/6964
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Discovering .ts files under node_modules resulting in them being compiled","articleBody":"I uncovered this general issue while testing loading JavaScript files from `node_modules`, but realized (and confirmed) this applies to TypeScript files also.\n\nBasically, when we search the `node_modules` folder, we [look for all supported extensions](https://github.com/Microsoft/TypeScript/blob/release-1.8/src/compiler/program.ts#L139) and add them to the compilation. Currently this means that if we find a TypeScript file in a Node module (e.g. someone published their package including the source), then we compile this also.\n\nFor example, if module `sausages` was published as follows (with the original source besides the compiler files):\n\n```\n - node_modules\n |- sausages\n |- package.json\n |- core.ts\n |- core.js\n```\n\nThen we get the benefit of loading the `.ts` and getting the types from this. However on compiling an app which uses the `sausages/core` module, with `outDir: \"out\"`, I get the resulting output (notice how `core.js` from the `sausages` package has been compiled into a `node_modules` folder in my `outDir`).\n\n\u003cimg width=\"133\" alt=\"screen shot 2016-02-08 at 9 42 56 am\" src=\"https://cloud.githubusercontent.com/assets/993909/12893862/7ec807b8-ce48-11e5-9b00-15608d67d28c.png\">\n\nI already added a flag to denote if a file was found by searching Node modules in [this pull request](https://github.com/Microsoft/TypeScript/pull/6928/files#diff-08a3cc4f1f9a51dbb468c2810f5229d3R72). I can refactor this to eliminate this issue if that seems reasonable.\n","author":{"url":"https://github.com/billti","@type":"Person","name":"billti"},"datePublished":"2016-02-08T17:46:55Z","url":"https://github.com/microsoft/TypeScript/issues/6964"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5e748065-d21f-3aa6-c335-6bfd53dec03f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BCCE:2F9718:D14387:119B581:6B010554 |
| html-safe-nonce | 184e9cc19854ae95e3f9501de88aa7eb92ca3f314d11c049a9ee225f91592a99 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0NFOjJGOTcxODpEMTQzODc6MTE5QjU4MTo2QjAxMDU1NCIsInZpc2l0b3JfaWQiOiIzNzAwMzEzNzQyNjMwNzgyMjkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7ba212e9bdf4b1d5ea677ef2d2a5761cc797f630b821748db8c3f774bb5154c1 |
| hovercard-subject-tag | issue:132211970 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/6964/issue_layout |
| twitter:image | https://opengraph.githubassets.com/19abf553264096b0af32dc70d41bbb758ca0b646258c74bb7f26ab937aba4f6c/microsoft/TypeScript/issues/6964 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/19abf553264096b0af32dc70d41bbb758ca0b646258c74bb7f26ab937aba4f6c/microsoft/TypeScript/issues/6964 |
| og:image:alt | I uncovered this general issue while testing loading JavaScript files from node_modules, but realized (and confirmed) this applies to TypeScript files also. Basically, when we search the node_modul... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | billti |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width