You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for a tool that can bundle multiple TypeScript files into a single TypeScript file while properly handling type imports. I wanted to check if anyone has already created something similar with the new typescript compiler.
Use Case
Take multiple TypeScript files that import from each other and external packages, then generate a single TypeScript file that works standalone with all dependencies inlined.
Only the necessary type definitions from external packages (like the GlobTask type from globby)
Preserves the original exports
Key Requirements
Must handle both local imports and external package imports
Must properly handle type-only imports (import type)
Should intelligently exclude Node.js built-in modules
Ideally allows configuring which packages should be kept external vs bundled
Provide customizability where needed
I was hoping the new typescript compiler might be a great tool to accomplish something like this. Has anyone built something like this or have suggestions for how to approach it?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
TypeScript Single-File Bundler That Preserves Types
Referencing
I'm looking for a tool that can bundle multiple TypeScript files into a single TypeScript file while properly handling type imports. I wanted to check if anyone has already created something similar with the new typescript compiler.
Use Case
Take multiple TypeScript files that import from each other and external packages, then generate a single TypeScript file that works standalone with all dependencies inlined.
Example Input
Expected Output
A single TypeScript file that contains:
GlobTask
type from globby)Key Requirements
import type
)I was hoping the new typescript compiler might be a great tool to accomplish something like this. Has anyone built something like this or have suggestions for how to approach it?
Beta Was this translation helpful? Give feedback.
All reactions