Skip to content

Instantly share code, notes, and snippets.

@millsp
Last active May 21, 2020 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save millsp/0a3015d90b9981b25f20c66837f6a407 to your computer and use it in GitHub Desktop.
Save millsp/0a3015d90b9981b25f20c66837f6a407 to your computer and use it in GitHub Desktop.
Create a single bundle of your TypeScript d.ts declaration files
#!/bin/bash
mkdir -p out
npx tsc src/index.ts -d --emitDeclarationOnly --module amd --outFile out/index.d.ts &&
echo "
declare module '<npm package name>' {
import main = require('index');
export = main;
}
" >> out/index.d.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment