Last active
April 22, 2025 19:18
-
-
Save millsp/0a3015d90b9981b25f20c66837f6a407 to your computer and use it in GitHub Desktop.
Create a single bundle of your TypeScript d.ts declaration files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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