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

Commit

Permalink
feat: remove useWebpackText option
Browse files Browse the repository at this point in the history
  • Loading branch information
s-panferov committed Jul 19, 2016
1 parent e36dc2d commit 5a99f21
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,6 @@ Collect file dependency graph and re-emit all dependent files along with the cha

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.

### useWebpackText *(boolean) (default=false)*

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.

### externals *(array)*

Array of paths to .d.ts files that must be included in program. Useful with `rewriteImports`.

### doTypeCheck *(boolean) (default=true)*

Use this setting to disable type checking.
Expand Down
19 changes: 11 additions & 8 deletions src/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,23 +264,26 @@ export class State {
updateFile(fileName: string, text: string, checked: boolean = false): boolean {
let prevFile = this.files[fileName];
let version = 0;
let changed = true;
let changed = false;
let isDefaultLib = false;

if (prevFile) {
isDefaultLib = prevFile.isDefaultLib;
if (!checked || (checked && text !== prevFile.text)) {
version = prevFile.version + 1;
} else {
changed = false;
changed = true;
}
} else {
changed = true;
}

this.files[fileName] = {
text,
version,
isDefaultLib
};
if (changed) {
this.files[fileName] = {
text,
version,
isDefaultLib
};
}

return changed;
}
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ function compiler(webpack: IWebPack, text: string): void {

instance.compiledFiles[fileName] = true;
let doUpdate = false;
if (instance.loaderConfig.useWebpackText) {
if (state.updateFile(fileName, text, true)) {
doUpdate = true;
}

if (state.updateFile(fileName, text, true)) {
state.fileAnalyzer.validFiles.markFileInvalid(fileName);
doUpdate = true;
}

try {
Expand Down
1 change: 0 additions & 1 deletion src/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export interface LoaderConfig {
reEmitDependentFiles?: boolean;
tsconfig?: string;
tsconfigContent?: string;
useWebpackText?: boolean;
externals?: string[];
doTypeCheck?: boolean;
ignoreDiagnostics?: number[];
Expand Down

0 comments on commit 5a99f21

Please sign in to comment.