Skip to content

Instantly share code, notes, and snippets.

@sourishkrout
Last active July 15, 2022 20:11
Show Gist options
  • Save sourishkrout/3f74947cc477f2752cd824e9e2f4ae11 to your computer and use it in GitHub Desktop.
Save sourishkrout/3f74947cc477f2752cd824e9e2f4ae11 to your computer and use it in GitHub Desktop.
problemMatcher that works well for webpack v5

Description

Simple example how to make VS Code auto-launch and present errors to you with zero extra effort. Just launch at will.

Email me at sebastian@stateful.com or join Discord to talk to us about VS Code tricks.

// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--disable-extensions"],
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"preLaunchTask": "npm: watch"
}
]
}
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"label": "npm: watch",
"isBackground": true,
"group": "build",
"problemMatcher": [
{
"pattern": [
{
"regexp": "ERROR in (.+)\\((\\d*,\\d*)\\)\\n(.+)$",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "^asset .+ related asset$",
"endsPattern": "^webpack .+ in \\d+ ms$"
}
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment