Imagine the following project structure
/src
index.ts
a.ts
/external
external.ts
When using the following tsconfig.json:
{
"compilerOptions": {
"outDir": "dist",
"declarationDir": "dist",
"declaration": true,
"baseUrl": "./src",
"paths": {
"@external/*": "../external/*"
}
},
"exclude": [
"dist"
]
}
The output will contain the external package
/dist
/src
a.d.ts
a.js
index.d.ts
index.js
/external
external.d.ts
external.js
When what I wanted was
/dist
a.d.ts
a.js
index.d.ts
index.js
Even when I add "external" in the exclude option, it still compiles and includes the external package.
Is there a way to avoid compiling the external module and consume it as it is?
EDIT: For context, the external module is compiled separately. The path is simply for getting types at dev time.