Skip to content

How can I read the version at runtime? #4

@justinmchase

Description

@justinmchase

The file is stored in the repo but I can't "import" it because its not a typescript file, and its not stored locally unless its imported... How can I read it at runtime?

Perhaps the version should be a .ts file? Maybe you could generate this?

// VERSION.ts
export const VERSION = "1.0.0"

I can't think of why a simple text file would be more useful than this. In the version script instead of reading the file you could then import it with const { VERSION } = import('./VERSION.ts'). I don't think you even need the --allow-read flag for that, I'm not sure though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions