Skip to content

Instantly share code, notes, and snippets.

@Legends
Last active January 5, 2020 00:56
Show Gist options
  • Select an option

  • Save Legends/89ee9849c31ea0a7ad95132b1a8357ed to your computer and use it in GitHub Desktop.

Select an option

Save Legends/89ee9849c31ea0a7ad95132b1a8357ed to your computer and use it in GitHub Desktop.
// ############################################## DEBUG YOUR WEBPACK-DEV-SERVER BUILD
launch.json (Debug->Add Configuration->Node):
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
// "skipFiles": [
// "<node_internals>/**"
// ],
"program": "${workspaceFolder}/node_modules/webpack-dev-server/bin/webpack-dev-server", //<-- POINTS TO WEBPACK-DEV-SERVER
"args": [
"--config",
"webpack.config.dev.js" // PROD/DEV
],
"autoAttachChildProcesses": true,
"stopOnEntry": true
}
]
}
// ############################################## DEBUG YOUR WEBPACK BUILD DEV/PROD
launch.json (Debug->Add Configuration->Node):
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
// "skipFiles": [
// "<node_internals>/**"
// ],
"program": "${workspaceFolder}/node_modules/webpack/bin/webpack", // <-- POINTS TO WEBPACK
"args": [
"--config",
"webpack.config.dev.js" // <-- dev or prod build
],
"autoAttachChildProcesses": true,
"stopOnEntry": true
}
]
}
// ############################################## DEBUG YOUR WEBPACK BUILD DEV/PROD USING CHROME BROWSER ENVIRONMENT
package.json
scripts{
"debug": "node --inspect --inspect-brk ./node_modules/webpack/bin/webpack.js --verbose --display-error-details --config webpack.config.dev.js",
}
console:--> yarn debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment