Skip to content

Instantly share code, notes, and snippets.

@AmrMekkawy
Last active April 29, 2018 03:53
Show Gist options
  • Save AmrMekkawy/76371e6382b4b08b2025c470216906a4 to your computer and use it in GitHub Desktop.
Save AmrMekkawy/76371e6382b4b08b2025c470216906a4 to your computer and use it in GitHub Desktop.
TypeScript Tips & Tricks

TypeScript Tips & Tricks


How to setup a workspace for your TypeScript project?

# Go to the root of you project
cd /d/path/to/your/project/directory/

# Put the project under the control of npm
npm init

# Install the "lite-server" package locally
npm install lite-server --save-dev

# Put the project under the control of tsc
tsc --init

# Start the "lite-server"
npm start
# Note that you should add "start" to the "package.json" file like this befor running the "npm start" command
"scripts": {
    "start": "lite-server"
}

# Now, when you want to compile all .ts files, just execute this command
tsc

More inof about Setting Up a Workspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment