-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow ".ts" in include/require statements. #49926
Comments
While there are other references.. the #38149 was closed along with other mentioned issues. To me, given that part of the purpose of TS should be to support browser usage, that explicitly requires an extension... it makes far MORE sense to include the output extension for files that TSC processes, not less. Just because it's easier to ignore the issue, does emphatically NOT mean it's not an issue. In fact, TSC should ADD the |
No idea what you're talking about. It's still open.
Rewriting paths has come up again and again, and the TypeScript team called this a huge no-go. Just check this issue: #49083 This is also something different from your initial issue. |
@MartinJohns it's pretty much the same issue... Being able to use the Those is for better compatibility with the browser and deno, while it also would not break node. |
We're not likely to transform paths, but the closest thing we may be considering is #37582. |
Suggestion
In order to align with Deno usage, as well as potentially future support for a browser loader, it would be beneficial to be able to include files with the
.ts
extension included.The option should be able to be configured. When enabled output of ".ts" extension should be omitted on the output.
If a module reference begins with
http:
,https:
or//
then the default behavior should be left in place. Possibly use separate option to download/process such modules placed in(outdir)/_cache/https__www.foo.com/path/to/mod.js
. where the protocol followed by two underscors is presented... preference for https, fallback to http in case of//
at the front.There's a pretty deep rabbit hole this could go down... that said, it would be really nice if it were easier to support Deno along with node and browser, and this would go a long way toward doing that. Since Deno can reference project code directly in typescript, it would allow projects to be Deno first, but still allow for build targets for node and browser usage.
🔍 Search Terms
List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
📃 Motivating Example
💻 Use Cases
The text was updated successfully, but these errors were encountered: