Skip to content

Commit bb022a7

Browse files
segreyjohnjbarton
authored andcommitted
fix(file-list): revert "do not preprocess up-to-date files" (#3226) (#3230)
This reverts commit 5334d1a karma-webpack preprocessor updates bundle when needed, but karma's fileList consists of a single entry file which is usually unmodified. In this case, fileList.refresh() should always call preprocessor for the single entry file, avoiding preprocessing of unmodified files is done on karma-webpack side.
1 parent 169f3a9 commit bb022a7

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

lib/file-list.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,6 @@ class FileList {
102102
return Promise.resolve(file)
103103
}
104104

105-
const prevFile = this._findFile(path, patternObject)
106-
if (prevFile && file.mtime <= prevFile.mtime) {
107-
log.debug(`Not preprocessing "${path}" as file hasn't been changed since the last preprocessing`)
108-
return Promise.resolve(prevFile)
109-
}
110-
111105
return this._preprocess(file).then(() => file)
112106
})
113107
.then((files) => {

test/unit/file-list.spec.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,15 +375,9 @@ describe('FileList', () => {
375375
})
376376
})
377377

378-
it('preprocesses new and/or changed files', () => {
378+
it('preprocesses all files', () => {
379379
return list.refresh().then((files) => {
380380
expect(preprocess.callCount).to.be.eql(5)
381-
preprocess.resetHistory()
382-
mg.statCache['/some/a.js'].mtime++
383-
return list.refresh().then((files) => {
384-
expect(preprocess.callCount).to.be.eql(1)
385-
mg.statCache['/some/a.js'].mtime--
386-
})
387381
})
388382
})
389383

0 commit comments

Comments
 (0)