integrate vs code with webpack-dev-server

1.1k views Asked by At

right now I start serving the application using webpack-dev-server.

Now If I make any code change in VS Code which causes the build failure the webpack-dev-server will rerun and report the failure, but I dont get to see those in VS Code.

I can use the VS Code typescript template to do that, but then its like multiple parallel compilation will happen for same code base.

Hence how can I integrate webpack-dev-server with vs-code to get compilation issues linked with vs-code

1

There are 1 answers

0
harishr On

in .vscode/launch.json (add below code for webpack-4):

{
  "type": "node",
  "request": "launch",
  "name": "build",
  "program": "${workspaceFolder}/node_modules/.bin/webpack-cli",
  "args": [
    "--config",
    "webpack.config.prod.js"
  ],
  "autoAttachChildProcesses": true,
  "stopOnEntry": true
}