Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Last active July 14, 2019 05:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecilemuller/77f0ce1382ead6cadfc12e742105c891 to your computer and use it in GitHub Desktop.
Save cecilemuller/77f0ce1382ead6cadfc12e742105c891 to your computer and use it in GitHub Desktop.
VSCode: Compile Typescript on file save
{
"version": "2.0.0",
"tasks": [
{
"label": "Delete Output Folder",
"type": "shell",
"options": {
"cwd": "${workspaceRoot}"
},
"command": "rm",
"args": ["-R", "./lib"],
"presentation": {
"reveal": "never"
}
},
{
"label": "Create Output Folder",
"dependsOn": ["Delete Output Folder"],
"type": "shell",
"options": {
"cwd": "${workspaceRoot}"
},
"command": "mkdir",
"args": ["lib"],
"presentation": {
"reveal": "never"
}
},
{
"label": "Compile On Save",
"dependsOn": ["Create Output Folder"],
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
],
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
{
"compilerOptions": {
"newLine": "LF",
"alwaysStrict": true,
"noEmitOnError": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"preserveConstEnums": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"allowJs": false,
"module": "commonjs",
"lib": ["es2017"],
"target": "es5",
"sourceMap": false,
"removeComments": true,
"outDir": "lib"
},
"include": [
"./src/**/*",
"./src/node_modules/**/*"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment