Hi Maybe someone is aware: Pulumi ignores my custo...
# typescript
c
Hi Maybe someone is aware: Pulumi ignores my custom typings in
d.ts
files. How to force Pulumi to read these files? Typescript sees them and compiles, but Pulumi doesn’t
l
Are these files put in a different (output) directory than your normal .ts files? Or are they in the same directory? Pulumi uses ts-node by default, and reads files from the source directory, not the outDir configured in tsconfig.json. If you're putting your .d.ts files in the outDir, alongside .js and .d.ts files transpiled by tsc, then Pulumi won't see them. If this is the case, you can either put your .d.ts files in the source directory, or configure Pulumi not to use ts-node. https://www.pulumi.com/docs/intro/languages/javascript/#disabling-built-in-typescript-support
c
Thank you. This works, but need to build app every time before runnig pulumi
l
You can put the .d.ts files in your source directory, then you won't need to rebuild. Pulumi uses ts-node, which has no transpile step, it runs directly from the .ts files. You need to make your .d.ts files findable for ts-node.
c
it was in there and no luck.
l
Ah. I don't know then. Maybe the ts-node docs explain how to get this working? It's almost certainly not a Pulumi-specific problem, it's about how the auto-transpilation thing in ts-node finds files and makes them available to the JS engine...