スキップしてメイン コンテンツに移動

投稿

3月, 2020の投稿を表示しています

[TypeScript] Read source code of tsc 2(incremental)

Intro [TypeScript] About tsconfig 1 [TypeScript] Read source code of tsc 1(Parse options) The result of parsing, the instance of BuildOptions is created. compiler/tsbuildPublic.ts export interface BuildOptions { dry?: boolean; force?: boolean; verbose?: boolean; /*@internal*/ clean?: boolean; /*@internal*/ watch?: boolean; /*@internal*/ help?: boolean; /*@internal*/ preserveWatchOutput?: boolean; /*@internal*/ listEmittedFiles?: boolean; /*@internal*/ listFiles?: boolean; /*@internal*/ pretty?: boolean; incremental?: boolean; assumeChangesOnlyAffectDirectDependencies?: boolean; traceResolution?: boolean; /* @internal */ diagnostics?: boolean; /* @internal */ extendedDiagnostics?: boolean; /* @internal */ locale?: string; /* @internal */ generateCpuProfile?: string; [option: string]: CompilerOptionsValue | undefined; } It inclu

[TypeScript] Read source code of tsc 1(Parse options)

Intro Because I want to know how to save the changes for the "incremental" option, I try to read the source code. They are in the TypeScript project. GitHub - microsoft/TypeScript: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. This time, I write about how to parse the tsc command from src > tsc > tsc.ts. According to the tsconfig.json of tsc, it refers "compiler" and "executeCommandLine". tsc/tsconfig.json "references": [ { "path": "../compiler", "prepend": true }, { "path": "../executeCommandLine", "prepend": true } ] tsc.ts and sys.ts https://github.com/microsoft/TypeScript/blob/master/src/tsc/tsc.ts In this code, I think the most important for understanding how to parse the command is here. tsc/tsc.ts ts.executeCommandLine(ts.sys, ts.noop, ts.sys.args); The first argument had system info of Node.js. https

[TypeScript] About tsconfig 1

Intro On the section 2 of " Effective TypeScript " had been written about setting "noImplicitAny", "strictNullChecks" and etc. And I wanted to know more about the tsconfig.json. What could I do through the settings of it? This time, I wrote about "allowJs", "checkJs", "incremental", and "tsBuildInfoFile". Environment TypeScript: ver. 3.8.2 tsc: ver.1.20150623.0 Resources Compiler Options - TypeScript TypeScript: TSConfig Reference - Docs on every TSConfig option Effective TypeScript Default tsconfig.json When I executed "tsc --init", I could get the default tsconfig.json. tsconfig.json { "compilerOptions": { /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', &