Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeScript make `outFile` to include dependencies

Tags:

typescript

It's possible to tell TypeScript compiler to bundle all files together into single build file using outFile option.

But it would bundle the *.ts files only and none of the dependencies from node_modules or the implementation of AMD loader.

I wonder if it's possible to tell TypeScript compiler to bundle everything in that file?

P.S.

I know about Brunch, WebPack and other bundle tools, but for simple cases it seems like an overkill, I'd like to get away with TS compiler only if possible.

like image 835
Alex Craft Avatar asked Dec 14 '17 17:12

Alex Craft


1 Answers

Late to the party, but I've written SAMD for this use case: https://github.com/morris/samd

It provides a minimal AMD implementation, sufficient for TypeScript AMD bundles and dependencies included via regular script tags.

It does not bundle dependencies, but you can simply concatenate dependencies if you want a single-file bundle (see README).

like image 128
morris4 Avatar answered Oct 16 '22 16:10

morris4