Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Commit 9c31177

Browse files
committed
fix: try to fix some places of potential performance degradation, refs #366
1 parent 95d2ee7 commit 9c31177

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/__test__/exclude.ts

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import {
2+
src, webpackConfig, expectErrors,
3+
tsconfig, compile, file, entry, spec
4+
} from './utils';
5+
6+
spec(__filename, async function() {
7+
file('vendor/with-err.ts', `
8+
export function error(a: number, b: string): number {
9+
return a + b
10+
}
11+
`);
12+
13+
file('vendor/with-err21.ts', `
14+
export function error(a, b)asdf {
15+
return a + b
16+
}
17+
`);
18+
19+
src('index.tsx', `
20+
console.log(1);
21+
`);
22+
23+
tsconfig({
24+
jsx: 'react',
25+
allowJs: true
26+
}, {
27+
exclude: ['vendor']
28+
});
29+
30+
let stats = await compile(webpackConfig(entry('index.tsx')));
31+
32+
expectErrors(stats, 0);
33+
});

src/checker/runtime.ts

+1
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
282282
function updateFile(fileName: string, text: string) {
283283
const file = files[fileName];
284284
if (file) {
285+
if (file.text === text) { return; }
285286
projectVersion++;
286287
file.version++;
287288
file.text = text;

0 commit comments

Comments
 (0)