Typescript. Create project in webstorm

Lets take an example from previous post and do the following steps

Add to project tsconfig.json

and edit it like this for example, point the out dir

  "compilerOptions": {
    "module": "commonjs",
    "target": "es5",
    "sourceMap": true,
    "outDir": "out"
  "exclude": [
  "include": [

Then alter the structure of files to the following

alter index.html

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <title>Hello world, typeScript!</title>
<div id="person"></div>
<script src="../out/index.js"></script>

open typescript tool panel

now press compile all in dropdown like below

as result we will see the js and map files in out directory, map files needed for debugging and can be disabled in tsconfig.json file by switching sourceMap field to false

This entry was posted in Без рубрики. Bookmark the permalink.