mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 15:25:54 -06:00
Merge pull request #13451 from Microsoft/gulp_tsconfig_inheritance
Fix tsconfig inheritance in gulpfile -- must do it manually
This commit is contained in:
commit
63333b47de
14
Gulpfile.ts
14
Gulpfile.ts
@ -242,13 +242,14 @@ function needsUpdate(source: string | string[], dest: string | string[]): boolea
|
||||
return true;
|
||||
}
|
||||
|
||||
// Doing tsconfig inheritance manually. https://github.com/ivogabe/gulp-typescript/issues/459
|
||||
const tsconfigBase = JSON.parse(fs.readFileSync("src/tsconfig-base.json", "utf-8")).compilerOptions;
|
||||
|
||||
function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): tsc.Settings {
|
||||
const copy: tsc.Settings = {};
|
||||
copy.noEmitOnError = true;
|
||||
copy.noImplicitAny = true;
|
||||
copy.noImplicitThis = true;
|
||||
copy.pretty = true;
|
||||
copy.types = [];
|
||||
for (const key in tsconfigBase) {
|
||||
copy[key] = tsconfigBase[key];
|
||||
}
|
||||
for (const key in base) {
|
||||
copy[key] = base[key];
|
||||
}
|
||||
@ -256,9 +257,6 @@ function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): ts
|
||||
if (copy.removeComments === undefined) copy.removeComments = true;
|
||||
copy.newLine = "lf";
|
||||
}
|
||||
else {
|
||||
copy.preserveConstEnums = true;
|
||||
}
|
||||
if (useBuiltCompiler === true) {
|
||||
copy.typescript = require("./built/local/typescript.js");
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ namespace ts {
|
||||
getFileSize?(path: string): number;
|
||||
writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
|
||||
/**
|
||||
* @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that
|
||||
* @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that
|
||||
* use native OS file watching
|
||||
*/
|
||||
watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": ["es5"],
|
||||
"noEmitOnError": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"noUnusedLocals": true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user