Skip to content

Commit

Permalink
fix: use file.originalPath instead of file.path (#218)
Browse files Browse the repository at this point in the history
Because other plugins (such as https://github.com/gjurgens/karma-renamer-preprocessor) may change the path.
  • Loading branch information
tjenkinson authored and joshwiens committed Oct 5, 2017
1 parent dbd72cb commit 0d075b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/karma-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 0d075b0

Please sign in to comment.