Search Terms
Suggestion
A way to configuration alias for declaration files.
Use Cases
Related: #10866
I understand that TypeScript team want to leaves module resolving for other tools like Webpack. However, most of the tools are focus on emitting JavaScript. If you want to emit TypeScript declaration, you need to use tsc.
This is important when you want to write library with TypeScript that you need to release declaration files.
For example, in Webpack, babel-loader does not emit declarations, ts-loader and awesome-typescript-loader uses tsc.
Alias is useful for you to write simpler import / export statement.
Examples
index.ts
index.d.ts
export * from "../../foo";
tsconfig.json
{
"alias": {
"~/*": ["src/*"]
}
}
Checklist
My suggestion meets these guidelines:
Search Terms
Suggestion
A way to configuration alias for declaration files.
Use Cases
Related: #10866
I understand that TypeScript team want to leaves module resolving for other tools like Webpack. However, most of the tools are focus on emitting JavaScript. If you want to emit TypeScript declaration, you need to use
tsc.This is important when you want to write library with TypeScript that you need to release declaration files.
For example, in Webpack,
babel-loaderdoes not emit declarations,ts-loaderandawesome-typescript-loaderusestsc.Alias is useful for you to write simpler import / export statement.
Examples
index.ts
index.d.ts
tsconfig.json
{ "alias": { "~/*": ["src/*"] } }Checklist
My suggestion meets these guidelines: