I use node.js connect/express.
Does anyone know an assets manager that supports on the fly compilation and minification of TypeScript source code?
Any idea how to call the compiler programmatically?
I've been using connect-assets which is build on top of Snockets. Shouldn't be that hard to implement once I figure how to compile a .ts resource.
From reading through the tsc.js code, it looks like there's a TypeScript.TypeScriptCompiler(outfile, errout, new TypeScript.NullLogger(), this.compilationSettings); function you could hook into. The code is on Codeplex, under an Apache license, and it's modular. Since TypeScript can be compiled to target CommonJS modules, it should be fairly straightforward to hack it into express.
Not a complete answer yet, but I found this project: which exposes the TypeScript compiler.
https://bitbucket.org/nxt/node-typescript-wrapper
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With