From 052ad890d2e5e3ba03e1f4efac09f5a06548971c Mon Sep 17 00:00:00 2001 From: Tom Jenkinson Date: Thu, 2 Feb 2017 11:50:18 +0100 Subject: [PATCH] Use originalPath not path Because other plugins (such as https://github.com/gjurgens/karma-renamer-preprocessor) may change the path. --- src/karma-webpack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/karma-webpack.js b/src/karma-webpack.js index 65c0d5b..6005b29 100644 --- a/src/karma-webpack.js +++ b/src/karma-webpack.js @@ -243,13 +243,13 @@ Plugin.prototype.readFile = function(file, callback) { function createPreprocesor(/* config.basePath */ basePath, webpackPlugin) { return function(content, file, done) { - if (webpackPlugin.addFile(file.path)) { + if (webpackPlugin.addFile(file.originalPath)) { // recompile as we have an asset that we have not seen before webpackPlugin.middleware.invalidate() } // read blocks until bundle is done - webpackPlugin.readFile(path.relative(basePath, file.path), function(err, content) { + webpackPlugin.readFile(path.relative(basePath, file.originalPath), function(err, content) { if (err) { throw err }