Skip to content

Commit 0d075b0

Browse files
tjenkinsonjoshwiens
authored andcommitted
fix: use file.originalPath instead of file.path (#218)
Because other plugins (such as https://github.com/gjurgens/karma-renamer-preprocessor) may change the path.
1 parent dbd72cb commit 0d075b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/karma-webpack.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ Plugin.prototype.readFile = function(file, callback) {
243243

244244
function createPreprocesor(/* config.basePath */ basePath, webpackPlugin) {
245245
return function(content, file, done) {
246-
if (webpackPlugin.addFile(file.path)) {
246+
if (webpackPlugin.addFile(file.originalPath)) {
247247
// recompile as we have an asset that we have not seen before
248248
webpackPlugin.middleware.invalidate()
249249
}
250250

251251
// read blocks until bundle is done
252-
webpackPlugin.readFile(path.relative(basePath, file.path), function(err, content) {
252+
webpackPlugin.readFile(path.relative(basePath, file.originalPath), function(err, content) {
253253
if (err) {
254254
throw err
255255
}

0 commit comments

Comments
 (0)