publicPrefixes
Prefixes the user configured, validated: a prefix that is empty or very short would expose almost every variable.
Prefixes the user configured, validated: a prefix that is empty or very short would expose almost every variable.
Import#
ts
import { publicPrefixes } from "@shadow-js/dusk/vite";
Signature#
ts
function publicPrefixes(configured: string | readonly string[] | undefined): string[]
Parameters#
| Name | Description |
|---|---|
configured |
The value of Vite's envPrefix, if any. |
Returns#
The prefixes to use, DUSK_PUBLIC_ first.
Throws#
- TypeError for an empty prefix,
*, or one shorter than three characters.
Examples#
ts
publicPrefixes("APP_"); // ["DUSK_PUBLIC_", "APP_"]