Skip to content

Instantly share code, notes, and snippets.

@vlrmprjct
Last active January 21, 2022 05:39
Show Gist options
  • Save vlrmprjct/2d0f888ec43ed0ff461cf6f87a94d110 to your computer and use it in GitHub Desktop.
Save vlrmprjct/2d0f888ec43ed0ff461cf6f87a94d110 to your computer and use it in GitHub Desktop.
VSCode run multiple build task
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
// **************************************************
// USING:
// npm install node-sass -g
// npm install uglify-js -g
// npm install html-minifier -g
// **************************************************
{
"version": "2.0.0",
"tasks": [
{
"taskName": "css-default",
"command": "node-sass",
"isShellCommand": true,
"args": ["${file}", "${fileDirname}/${fileBasenameNoExtension}.css", "--output-style=expanded", "--sourceMap=${fileDirname}"],
"showOutput": "silent"
},
{
"taskName": "css-minify",
"command": "node-sass",
"isShellCommand": true,
"args": ["${file}", "${fileDirname}/${fileBasenameNoExtension}.min.css", "--output-style=compressed", "--sourceMap=${fileDirname}"],
"showOutput": "silent"
},
{
"taskName": "js-minify",
"command": "uglifyjs",
"isShellCommand": true,
"args": ["${file}", "--compress", "--mangle", "--quotes 1", "--comments all", "--output ${fileDirname}/${fileBasenameNoExtension}.min.js", "--source-map ${fileDirname}/${file}.map"],
"showOutput": "silent"
},
{
"taskName": "build", // THE BUILD TASK
"isBuildCommand": true, // THIS KEY IDENTIFIES THE VSCODE BUILD TASK, RUN USING F1 => TASK BUILD
"dependsOn": ["css-default", "css-minify", "js-minify"] // THE MAGIC TO RUN MULTIPLE BUILD TASK BY TASKNAME
},
{
"taskName": "Example Terminal Output",
"command": "echo",
"isShellCommand": true,
"args": ["HelloWorld"],
"showOutput": "always"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment