Skip to content

Commit 4b904d9

Browse files
committed
Slightly improve source path tree in the browser debugger
1 parent 48924a6 commit 4b904d9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎webpack.config.js‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ module.exports = {
1111
{ test: /\.js$/, loader: "babel", include: path.resolve('./src') },
1212
]
1313
},
14+
output: {
15+
devtoolModuleFilenameTemplate: function(info) {
16+
// Reading input source maps gives only relative paths here for
17+
// everything. Until I figure out how to fix this, this is a
18+
// workaround.
19+
// We use the relative resource path with any '../'s on the front
20+
// removed which gives a tree with matrix-react-sdk and vector
21+
// trees smashed together, but this fixes everything being under
22+
// various levels of '.' and '..'
23+
return info.resourcePath.replace(/^[\/\.]*/, '');
24+
}
25+
},
1426
resolve: {
1527
alias: {
1628
// alias any requires to the react module to the one in our path, otherwise

0 commit comments

Comments
 (0)