TypeScript boilerplate.
This boilerplate can be used to start any TypeScript project. It also may be used for educational purposes. For a fresh installation, follow these steps.
- Install Node.js from https://nodejs.org.
- Install VSCode from http://code.visualstudio.com
- Install git from https://git-scm.com
- Install SourceTree from https://www.sourcetreeapp.com
- Clone https://github.com/sjohnsonaz/ts-boilerplate.git
- Run Command Prompt (
cmd
)npm install typescript -g
npm install webpack -g
npm install nodemon -g
- Open Project
- Go to
File->Open Folder...
- Open
ts-boilerplate
- Go to
- Configure hidden folders
- Go to
File->Preferences->Workspace Settings
- In the right pane, add a line for
"files.exclude"
- Add to the bottom of the
"files.exclude"
section:
- Go to
"node_modules/": true,
"dist/": true
- Save
-
Run Command Prompt (
cmd
)npm install
- To compile but not build, use
tsc
- To run once, use
npm run dev
- To run and watch for file changes, use
npm run watch
- To run once and minify, use
npm run min
-
Run VSCode
- Navigate to
ts-boilerplate/src/html/index.html
- Right click
index.html
- Click
Reveal in Explorer
- When Explorer launches, open the file in a Browser.
- Navigate to
-
Optionally, depending on your project, you may also run in Node
- Run Command Prompt (
cmd
) - To run once, use
npm node
- To run and watch for file changes, use
npm nodemon
- Run Command Prompt (
-
Test in Browser
- Run VSCode
- Navigate to
ts-boilerplate/src/mocha/index.html
- Right click
index.html
- Click
Reveal in Explorer
- When Explorer launches, open the file in a Browser
-
Test in Node
- Run Command Prompt (
cmd
) npm test
- Run Command Prompt (