Skip to content

Commit

Permalink
set import path to be dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
dasco144 committed Apr 30, 2024
1 parent 71890e4 commit ff1d6bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,9 @@ export async function getVersions(request: CodeGeneratorRequest) {
protocVersion = `v${major}.${minor}.${patch}`;
}

const packageJson = await import("../package.json");
const tsProtoVersion = `v${packageJson.version}`;
const path: string = "../package.json";
const packageJson = await import(path);
const tsProtoVersion = `v${packageJson?.version ?? "unknown"}`;

return {
protocVersion,
Expand Down

0 comments on commit ff1d6bc

Please sign in to comment.