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

Commit 5a99f21

Browse files
committed
feat: remove useWebpackText option
1 parent e36dc2d commit 5a99f21

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,6 @@ Collect file dependency graph and re-emit all dependent files along with the cha
123123

124124
Specifies the path to a TS config file. This is useful when you have multiple config files. This setting is useless *inside* a TS config file.
125125

126-
### useWebpackText *(boolean) (default=false)*
127-
128-
Use this setting to force the loader to use webpack's method of loading files. Useful only with ts-jsx-loader. Builds may become slower.
129-
130-
### externals *(array)*
131-
132-
Array of paths to .d.ts files that must be included in program. Useful with `rewriteImports`.
133-
134126
### doTypeCheck *(boolean) (default=true)*
135127

136128
Use this setting to disable type checking.

src/host.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -264,23 +264,26 @@ export class State {
264264
updateFile(fileName: string, text: string, checked: boolean = false): boolean {
265265
let prevFile = this.files[fileName];
266266
let version = 0;
267-
let changed = true;
267+
let changed = false;
268268
let isDefaultLib = false;
269269

270270
if (prevFile) {
271271
isDefaultLib = prevFile.isDefaultLib;
272272
if (!checked || (checked && text !== prevFile.text)) {
273273
version = prevFile.version + 1;
274-
} else {
275-
changed = false;
274+
changed = true;
276275
}
276+
} else {
277+
changed = true;
277278
}
278279

279-
this.files[fileName] = {
280-
text,
281-
version,
282-
isDefaultLib
283-
};
280+
if (changed) {
281+
this.files[fileName] = {
282+
text,
283+
version,
284+
isDefaultLib
285+
};
286+
}
284287

285288
return changed;
286289
}

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ function compiler(webpack: IWebPack, text: string): void {
5959

6060
instance.compiledFiles[fileName] = true;
6161
let doUpdate = false;
62-
if (instance.loaderConfig.useWebpackText) {
63-
if (state.updateFile(fileName, text, true)) {
64-
doUpdate = true;
65-
}
62+
63+
if (state.updateFile(fileName, text, true)) {
64+
state.fileAnalyzer.validFiles.markFileInvalid(fileName);
65+
doUpdate = true;
6666
}
6767

6868
try {

src/instance.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ export interface LoaderConfig {
7070
reEmitDependentFiles?: boolean;
7171
tsconfig?: string;
7272
tsconfigContent?: string;
73-
useWebpackText?: boolean;
7473
externals?: string[];
7574
doTypeCheck?: boolean;
7675
ignoreDiagnostics?: number[];

0 commit comments

Comments
 (0)