An example setup using TypeScript and Watchify for front-end web development.
- Install Node.js
- Install TypeScript:
npm install -g typescript
- Install Watchify:
npm install -g watchify
- Run
tsc --watch
to compile TypeScript to JavaScript and watch for changes, recompiling when they are detected. - Run
watchify out/main.js -o out/bundle.js -v
to bundle modules into a single file and watch for changes. - Load
index.html
in a browser served from a local web server.- The Visual Studio Code extension Live Server is great for this.
- Update TypeScript files in the
src
folder and observe changes in your browser.