Skip to content

Commit

Permalink
fix(karma-webpack): normalize paths to be compatible with windows
Browse files Browse the repository at this point in the history
  • Loading branch information
igomezal authored and matthieu-foucault committed Feb 13, 2019
1 parent ac7fe8b commit b783e1c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/karma-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ function preprocessorFactory(config, emitter) {
controller.karmaEmitter = emitter;
}

const normalize = (file) => file.replace(/\\/g, '/');

const transformPath =
config.webpack.transformPath ||
((filepath) => {
Expand All @@ -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);
Expand Down

0 comments on commit b783e1c

Please sign in to comment.