Skip to content

Commit 4820d25

Browse files
authored
Merge pull request #8 from aabidsofi19/fix/compilerOptions
fix compiler options to export as esnext
2 parents 2d11e09 + c06c19e commit 4820d25

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

src/apiCompilerConfig.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/app.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#! /usr/bin/env node
22
var { program } = require("commander");
33
var { exec } = require("child_process");
4-
var { renameSync, rmdirSync, unlinkSync } = require("fs");
5-
var { dirname, basename, join } = require("path");
4+
var { unlinkSync } = require("fs");
65
var fs = require("fs");
76
var ts = require("typescript");
8-
var compileConfig = require("./apiCompilerConfig.json");
97

108
program
119
.option("-i, --input <input>", "Input YAML schema file path")
@@ -19,7 +17,20 @@ program
1917
const compileApi = (tsPath, outputPath) => {
2018
// read ts file
2119
const tsFile = fs.readFileSync(tsPath, "utf8");
22-
const result = ts.transpile(tsFile, compileConfig);
20+
const result = ts.transpile(tsFile, {
21+
target: "ESNext",
22+
esModuleInterop: true,
23+
forceConsistentCasingInFileNames: false,
24+
strict: false,
25+
noImplicitAny: false,
26+
skipLibCheck: true,
27+
module: "ESNext",
28+
declaration: false,
29+
sourceMap: false,
30+
moduleResolution: "node",
31+
allowSyntheticDefaultImports: true,
32+
emitDeclarationOnly: false,
33+
});
2334
console.log("Writing output to " + outputPath);
2435
fs.writeFileSync(outputPath, result);
2536
};

0 commit comments

Comments
 (0)