What is the simplest and fastest way to set up a TypeScript web application with node modules, that compiles into one JavaScript file that can be called from HTML?
For example, if I have the following project structure:
├── node_modules
│ └── mathjs
│ └── (dependencies, etc.)
├── public
│ └── index.html
│ └── app.js
├── src
│ └── app.ts
├── package-lock.json
└── package.json
app.ts contains the following code with node modules and typing imports:
import math from "mathjs";
import { Matrix } from "mathjs";
const point: Matrix = math.matrix([ +1, +1, +1 ]);
// etc...
How can I make it so that app.ts and all its dependencies are compiled into a single file app.js in the public directory such that, it can be included at the bottom of the body tag in index.html and be run in a browser?
<script type="module" src="/app.js"></script>
In other words, what CLI tools can I use to compile this project for the web?
I have spent hours trying to research and get something to work (without copying and pasting directly from node_modules) and have not been able to get anything to work. Any help will be greatly appreciated!
Edit: Parcel is exactly what I was looking for.