Relative paths in source maps
I'm trying to switch from jsx-loader. My webpack.config.js is like this:
module.exports = {
entry: './src/javascript/main.jsx',
output: {
devtoolModuleFilenameTemplate: '[resource-path]',
path: './public/js/',
filename: 'bundle.js'
},
module: {
loaders: [
{ test: /\.jsx$/, loaders: ['jsx'] }
]
}
};
This will produce relative paths in source maps.
{
sources: ["./src/javascript/main.jsx"]
}
If I use babel-loader with the same config, it will produce absolute paths.
{
sources: ["/full/path/src/javascript/main.jsx"]
}
Are there any methods to solve this problem?
I second this, it's not nice having full paths..
Agreed, I experience the same issue. The incorrect paths seem to break the WebStorm debugger.
+1
Same here, babel-loader v.6.2.0
I came up with a simple fix that should solve the problem - check it out.
Is this still a problem?
when I try to reproduce the sources look like this: "./fixtures/constant.js"
Invalid absolute resource paths are the reason.
[email protected]
[email protected]

Just noticed this may be a duplicate of the issue I just filed #480
@byelims you probably need to check whether in your .babelrc your babel presets for production env is different (e.g. if using react it's not react-hmre) than your development.