From b783e1ce620e8e733109de594211e1910ba991ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20G=C3=B3mez=20Alonso?= Date: Mon, 11 Feb 2019 20:50:54 +0100 Subject: [PATCH] fix(karma-webpack): normalize paths to be compatible with windows --- lib/karma-webpack.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/karma-webpack.js b/lib/karma-webpack.js index 686329d..44e016f 100644 --- a/lib/karma-webpack.js +++ b/lib/karma-webpack.js @@ -82,6 +82,8 @@ function preprocessorFactory(config, emitter) { controller.karmaEmitter = emitter; } + const normalize = (file) => file.replace(/\\/g, '/'); + const transformPath = config.webpack.transformPath || ((filepath) => { @@ -93,7 +95,7 @@ function preprocessorFactory(config, emitter) { return async function processFile(content, file, done) { await controller.bundle(); - file.path = transformPath(file.path); // eslint-disable-line no-param-reassign + file.path = normalize(transformPath(file.path)); // eslint-disable-line no-param-reassign const bundleContent = controller.bundlesContent[path.parse(file.path).base]; done(null, bundleContent);