-
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.
Add s2ts version to compiled code for debuging
- Loading branch information
1 parent
08486b7
commit 3604d37
Showing
8 changed files
with
34 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
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
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,12 @@ | ||
import { existsSync, readFileSync, unlinkSync, writeFileSync } from "fs" | ||
import path from "path" | ||
|
||
const indexFilePath = path.join(process.cwd(), "dist/index.js") | ||
const fileContent = readFileSync(indexFilePath, "utf8") | ||
const fileContentWithVersion = fileContent.replace("process.env.npm_package_version", `"${process.env.npm_package_version}"`) | ||
writeFileSync(indexFilePath, fileContentWithVersion) | ||
|
||
const fileToRemovePath = path.join(process.cwd(), "dist/postBuild.js") | ||
if (existsSync(fileToRemovePath)) { | ||
unlinkSync(fileToRemovePath) | ||
} |
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
Binary file not shown.
Binary file not shown.