-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure codegen configs to skip duplicate codegen when file already…
… exists (#197) * Configure codegen configs to skip duplicate codegen when file already exists * Add optional env-oriented file to improve performance
- Loading branch information
Showing
4 changed files
with
40 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import fs from "fs"; | ||
import path from "path"; | ||
|
||
export default function checkExistingCodegen(isProduction: boolean) { | ||
const generatesFile = isProduction | ||
? "dist/temp_api/index.tsx" | ||
: "src/api/generated/index.tsx"; | ||
const generatesFilePath = path.resolve(__dirname, generatesFile); | ||
|
||
return { | ||
codegenFileExists: fs.existsSync(generatesFilePath), | ||
generatesFile, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters