anyone having trouble getting global types working...
# typescript
o
anyone having trouble getting global types working with latest pulumi's
ts-node
? (
tsconfig.json
in 🧵 for reference) something like
src/global.d.ts
?
Copy code
// src/global.ts
declare global {
  export type SomeGlobal = 'why pulumi no like me?'
}
export {};


// some other file like stack.ts
export const thing = 'hello world' satisfies SomeGlobal;
pulumi preview
results in
Copy code
TSError: ⨯ Unable to compile TypeScript:
path/to/stack.ts(17,63): error TS2304: Cannot find name 'SomeGlobal'.
Copy code
{
  "extends": "../../tsconfig.json",
  "ts-node": {
    "esm": true,
    "files": true,
    "transpileOnly": true,
    "swc": false,
  },
  "compilerOptions": {
    "rootDir": "./",
    "baseUrl": "./src",
    "declaration": true,
    "composite": true,
    "incremental": true,
    "typeRoots": ["src/global.d.ts"]
  },
  "include": ["src"]
}