Skip to content

Commit b783e1c

Browse files
igomezalmatthieu-foucault
authored andcommitted
fix(karma-webpack): normalize paths to be compatible with windows
1 parent ac7fe8b commit b783e1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/karma-webpack.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ function preprocessorFactory(config, emitter) {
8282
controller.karmaEmitter = emitter;
8383
}
8484

85+
const normalize = (file) => file.replace(/\\/g, '/');
86+
8587
const transformPath =
8688
config.webpack.transformPath ||
8789
((filepath) => {
@@ -93,7 +95,7 @@ function preprocessorFactory(config, emitter) {
9395
return async function processFile(content, file, done) {
9496
await controller.bundle();
9597

96-
file.path = transformPath(file.path); // eslint-disable-line no-param-reassign
98+
file.path = normalize(transformPath(file.path)); // eslint-disable-line no-param-reassign
9799

98100
const bundleContent = controller.bundlesContent[path.parse(file.path).base];
99101
done(null, bundleContent);

0 commit comments

Comments
 (0)