{ "compilerOptions": { "allowJs": true, "declaration": false, "esModuleInterop": true, "incremental": true, "module": "commonjs", "moduleResolution": "node", "outDir": "./dist", "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true, // Here in app/tsconfig.json, we want to set the `target` and `lib` keys to // the "best" values for the version of Node **coming with the chosen Electron**. // Careful: we're *not* talking about Nativefier's (CLI) required Node version, // we're talking about the version of the Node runtime **bundled with Electron**. // // Like in our main tsconfig.json, we want to be as conservative as possible, // to support (as much as reasonable) users using old versions of Electron. // Then, at some point, an app dependency (declared in app/package.json) // will require a more recent Node, then it's okay to bump our app compilerOptions // to what's supported by the more recent Node. // // TS doesn't offer any easy "preset" for this, so the best we have is to // believe people who know which {syntax, library} parts of current EcmaScript // are supported for the version of Node coming with the Electron being used, // and use what they recommend. For the current Node version, I followed // https://stackoverflow.com/questions/51716406/typescript-tsconfig-settings-for-node-js-10 // and 'dom' to tell tsc it's okay to use the URL object (which is in Node >= 7) "target": "es2018", "lib": ["es2018", "dom"] }, "include": [ "./src/**/*" ] }