Skip to content

Commit 757af2e

Browse files
author
Andy Hanson
committed
Fix tsconfig inheritance in gulpfile -- must do it manually
1 parent a36db0e commit 757af2e

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

Gulpfile.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,23 +242,21 @@ function needsUpdate(source: string | string[], dest: string | string[]): boolea
242242
return true;
243243
}
244244

245+
// Doing tsconfig inheritance manually. https://github.com/ivogabe/gulp-typescript/issues/459
246+
const tsconfigBase = JSON.parse(fs.readFileSync("src/tsconfig-base.json", "utf-8")).compilerOptions;
247+
245248
function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): tsc.Settings {
246249
const copy: tsc.Settings = {};
247-
copy.noEmitOnError = true;
248-
copy.noImplicitAny = true;
249-
copy.noImplicitThis = true;
250-
copy.pretty = true;
251-
copy.types = [];
250+
for (const key in tsconfigBase) {
251+
copy[key] = tsconfigBase[key];
252+
}
252253
for (const key in base) {
253254
copy[key] = base[key];
254255
}
255256
if (!useDebugMode) {
256257
if (copy.removeComments === undefined) copy.removeComments = true;
257258
copy.newLine = "lf";
258259
}
259-
else {
260-
copy.preserveConstEnums = true;
261-
}
262260
if (useBuiltCompiler === true) {
263261
copy.typescript = require("./built/local/typescript.js");
264262
}

src/compiler/sys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace ts {
1818
getFileSize?(path: string): number;
1919
writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
2020
/**
21-
* @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that
21+
* @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that
2222
* use native OS file watching
2323
*/
2424
watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher;

src/tsconfig-base.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"lib": ["es5"],
3+
"noEmitOnError": true,
44
"noImplicitAny": true,
55
"noImplicitThis": true,
66
"noUnusedLocals": true,

0 commit comments

Comments
 (0)