I have a nodejs express application, which I'm attempting to bundle with webpack 4 (plus babel 7.1.0). I've followed some of the setup from these two articles:

* [Webpack Javascript Bundling for Both Front-end and Back-end (nodejs)](https://medium.com/code-oil/webpack-javascript-bundling-for-both-front-end-and-back-end-b95f1b429810)
* [Creating a server bundle with Webpack for universal rendering](https://medium.com/@muthuks/creating-a-server-bundle-with-webpack-for-universal-rendering-50bf0b71af79)

I can build and run the server once bundled, but I'd like to be able to debug it using VS Code's debug environment.

I've tried the following combination of webpack and vscode config, but it doesn't set breakpoints or let me step into the code.

.vscode/launch.json

```
{
    "type": "node",
    "request": "launch",
    "name": "bundle-server.js",
    "program": "${workspaceFolder}\\bundle-server.js",
    "sourceMaps": true,
    "smartStep": true,
}

```

webpack-server.config.js

```
const path = require('path');
const nodeExternals = require('webpack-node-externals');

module.exports = {
    target: "node",
    entry: "./server.js",
    output: {
        path: path.resolve(__dirname, "./"),
        filename: "bundle-server.js",
    },
    module: {
        rules: [
            {
                test: /\.jsx?$/,
                loader: "babel-loader"
            }
        ],
    },
    externals: [nodeExternals()],
    devtool: 'inline-source-map',
};

```

What am I missing? Is it even possible to debug directly from VSCode? I'd like to be able to step over the original source files so I can have a quick debug-edit-rerun loop.

---

Seems related to this: [Debug webpack bundled node ts with Visual Studio Code](https://stackoverflow.com/questions/36470946/debug-webpack-bundled-node-ts-with-visual-studio-code).