Skip to content

Expose build info to beforeDevCommand and beforeBuildCommand #2610

@JonasKruckenberg

Description

@JonasKruckenberg

Is your feature request related to a problem? Please describe.
The os and app APIs already provide a way to retrieve information about the app such as arch, platform and type.
I'd like to use the Vite env var feature to only include platform specific code on that platform.

Describe the solution you'd like
As the properties mentioned above are statically set anyway, we can also expose them as environment variables during build right?

Describe alternatives you've considered
Some properties can be sourced from different locations to provide a similar behavior (taking the OS from GitHub actions env vars for example) but I've yet to find a way to access the arch.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: api.jsThe @tauri-apps/api npm package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions