-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
π Search Terms
import, map, path, alias, scope
β Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
β Suggestion
I'm curious to hear thoughts on introducing an importMap option in compilerOptions.
Some initial thoughts:
- Import maps are a WICG standard.
- They can effectively replace
pathsfor most use cases. - They're supported by Deno.
- Projects with colocated Node and Deno workspaces could leverage the same source of truth regarding imports/aliases.
- Import maps provide the ability to configure
scopes(extremely useful in my experience)
π Motivating Example
Every project that utilizes import maps.
π» Use Cases
- What do you want to use this for?
Simplifying my configuration in projects that contain both Node and Deno workspaces.
- What shortcomings exist with current approaches?
One needs to re-specify their aliases in numerous places.
- What workarounds are you using in the meantime?
N/A
frandmb
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript