From 4b904d90f26fc9c103c6be5df6f7d4d4a9ec640f Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 15 Oct 2015 14:40:36 +0100 Subject: [PATCH] Slightly improve source path tree in the browser debugger --- webpack.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index 74e711135f..7868699dab 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,6 +11,18 @@ module.exports = { { test: /\.js$/, loader: "babel", include: path.resolve('./src') }, ] }, + output: { + devtoolModuleFilenameTemplate: function(info) { + // Reading input source maps gives only relative paths here for + // everything. Until I figure out how to fix this, this is a + // workaround. + // We use the relative resource path with any '../'s on the front + // removed which gives a tree with matrix-react-sdk and vector + // trees smashed together, but this fixes everything being under + // various levels of '.' and '..' + return info.resourcePath.replace(/^[\/\.]*/, ''); + } + }, resolve: { alias: { // alias any requires to the react module to the one in our path, otherwise