How To Debugging Webpack with VS Code

ngovu.dl@gmail.com | 259 day | 374


At the moment "webpack.config.js" is very popular, with FE build, so how to know what is webpack do, and now I will guide you on how to debugging with webpack on VS CODE.

First of all, you need to open VS CODE and add a "Debugger" in VS CODE like below.

c-sharp.vn

 After done with the above, next we will see a file "launch.js" like below

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Webpack",
             "program": "${workspaceFolder}/scripts/build.js"
        }
    ]
}
For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387.
 
So here we need to focus on "program" because it helps us debug a file we want.
 
For example:
 "scripts": {
    "start": "node scripts/start.js",
    "build": "node scripts/build.js",
    "test": "node scripts/test.js --env=jsdom"
  },

With the code above in "package.json" I have been created 3 commands "start, build, test", so here I will to debug when executing "yarn build or npm run build". I will set the "program" like this

"program": "${workspaceFolder}/scripts/build.js"

c-sharp.vn

and after you click "Start-Debugging" it is automatically accessed to the script folder and "build.js" to debug.

c-sharp.vn

So I hope the article will help you solve the problem with Webpack.


Top Articles

Bất Đầu Với WebApi Và Dot Net Core (.Net Core)

1131 day
Butter Ngo
Views 6822
Comments 0

Repository Và Unit Of Work (Entity Framework)

1050 day
ndtung449@gmail.com
Views 4161
Comments 0

Dot Net Core Bearer Token With (JWT) (.Net Core)

1063 day
Butter Ngo
Views 4156
Comments 0

Bắt Đầu Với Dot NET Core (.Net Core)

1142 day
Butter Ngo
Views 3833
Comments 0

Top Question

Bi lỗi Invalid Column Name khi sử dụng LinQ (.Net)

990 day
Bảo Dương
Views 1058
Answers 2

Làm thế nào để lấy information từ token (.Net Core)

380 day
ngovu.dl@gmail.com
Views 604
Answers 1

.NET CORE API JWT (.Net Core)

283 day
huynhminhnhut97@gmail.com
Views 594
Answers 2