Breakpoint not being hit after hot module reload

167 Views Asked by At

I have a node server running in debug which works fine and hits breakpoints. Also i have hot module replace hooked up.

When changes are made, the HMR updates the files and the changes can be seen. However, now it just skips past the breakpoints.

I'm assuming that when the HMR file is created the debugger doesn't know about the new file eg. main.<hashcode>.js or somehow the link is lost.

Is there any way tell the debugger there is a new file without restarting the debug session?

Maybe some extra config in webpack config eg.

output: {
    path: path.join(__dirname, 'dist', 'server'),
    filename: './main.js'
  }
1

There are 1 best solutions below

1
On

You can use watchOptions.ignored

module.exports = {
  //...
  watchOptions: {
    ignored: ['/path/main*.js']
  }
};