'Map file has the wrong path

I'm using webpack and when debugging my javascript file, it has the wrong path so I'm just getting a read-only copy of the file.

My folded structure:

www\
     \src
     \src\App.tsx
     \build

Snippet of my webpack.js file

mode: 'development',
devtool: 'eval-source-map',
entry: './src/index.tsx',
    output: {
    filename: 'bundle.js',
    path: path.join(__dirname, 'build'),
},

But when the debugger hits the file App.tsx, its the debugger read-only path

~/Projects/MyProgram/source/www/build/src/App.tsx

but the actual file is located in the following path

~/Projects/MyProgram/source/www/src/App.tsx

So the additional folder "build" is causing the issue. Any ideas on how to resolve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source