Skip to content

Expose $env/static/public module to service workers #5717

@Rich-Harris

Description

@Rich-Harris

Describe the problem

#5663 adds new modules with environment variables. In some cases it's useful to be able to access those env vars in a service worker.

It only makes sense to expose public environment variables for obvious reasons, so $env/static/private and $env/dynamic/private are out.

$env/dynamic/public could potentially be useful, but I have no idea how it would work. I think 'service workers can only use public environment variables that are known at build time' is a reasonable restriction.

Describe the proposed solution

Expose $env/static/public to service workers.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions