// .vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
// 👉 This is the target task to trigger on file changes
{
"type": "process",
"command": "echo Hello World!",
"label": "echo",
"problemMatcher": []
},
// 👇 This is the task that triggers your target task
{
// ////////////////////
// Built-in Fields:
"label": "entr: echo",
"problemMatcher": [],
// ////////////////////
// Required Fields:
"type": "entr", // Constant value
"targetTask": "echo", // 👈 Important!
// ////////////////////
// Optional Fields:
"files": [
"src/*.*"
],
// Whether to ignore types of events
"ignoreCreateEvents": false,
"ignoreChangeEvents": false,
"ignoreDeleteEvents": false,
// Whether to ignore folder level events
"onlyFiles": false,
// The time to wait in milliseconds
// before running the task after any file
// system change is triggered
"pauseMsBeforeRun": 100,
},
// 👇 This is the same task that triggers your target task
// But simplified with default values
{
"label": "entr: echo (simple)",
"type": "entr",
"targetTask": "echo"
}
]
}
Modify any file in your workspace. You should see the echo task being re-triggered.
Known Issues
There is a known issue where modifying any files under .vscode folder triggers your task 3 times. This is a known issue and is being worked on.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.