diff --git a/generator.ts b/generator.ts index 08ee4f1..cdc5fd2 100644 --- a/generator.ts +++ b/generator.ts @@ -187,7 +187,7 @@ function getAllFilePaths(directoryPath: string): string[] { writeFileSync(distFile, result, "utf-8"); // 执行编译 - exec(`tsc ${distFile} --noEmitHelpers`, (_, stdout) => { + exec(`tsc ${distFile} --noEmitHelpers --target ES2017`, (_, stdout) => { for (const line of stdout.split("\n")) { if (line.lastIndexOf("Cannot find name") === -1) { console.log(line); diff --git a/tsconfig.json b/tsconfig.json index 2e59053..bd4dea0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "moduleResolution": "NodeNext", - "target": "ESNext", + "target": "ES2017", "module": "NodeNext", "noEmitHelpers": true }