bdkjones / CodeKit2

CodeKit 2 Beta
98 stars 4 forks source link

[TypeScript 1.8] - Support module bundling CLI flag #597

Closed subhaze closed 1 year ago

subhaze commented 8 years ago

TypeScript 1.8 introduces the ability to concat modules when you're emitting the module output for either AMD or SystemJS.

This is my future request for supporting this :) Though, from the looks of it, it may not be a trivial update :/

The CLI is pretty simple but the file ordering will be important as it will concat based on the list of files given.

tsc --module system --outFile bundled.js foo.ts bar_requires_foo.ts blah_requires_bar.ts

So the dependency chain would need to be worked out on CodeKits side.

Sidenote: my current work around for bundling is manually keeping a list of files to //@codekit-append and have CodeKit process that file on any file changes in the list. This works, but would be amazing to see module bundling "Just Work" \o/

subhaze commented 8 years ago

The bundling is much better now. There's no need to compile a list of files as it will pull in the files needed based on dependencies.

tsc --module system|amd --outFile main-dist.js main.js

https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#concatenate-amd-and-system-modules-with---outfile