Originally these where JS files and all was well. But I wanted some simple type checking, so I converted to TypeScript.
What I would like is to compile all the .ts
files into one .js
suitable for use in the browser with a simple script tag.
This project does NOT include webpack, so please refrain from webpack related instructions.
I tried this
tsc main.ts --module amd --outFile main.js
and
tsc main.ts --module system --outFile main.js
But both seem to require I include a further third party library on the page.
Is there a way I can get all the files concatenated together so everything just works? I tried running the output of the amd built version through the browserify
command, but no dice.
If this doesn't work I will just go back to .js
and include with script tags like normal.
TLDR: How can I get bundled ts into a single js with no requirejs
or systemjs
dependency on the page?
--module none
should do it, but it means no modules, really - you can use only dependencies that are accessible via globals. – Chiefly<script>
tag. With modules, you can't use TypeScript compiler to produce single.js
file directly. – Chiefly