MCPcopy
hub / github.com/vitejs/vite / resolveEnvPrefix

Function resolveEnvPrefix

packages/vite/src/node/env.ts:109–127  ·  view source on GitHub ↗
({
  envPrefix = 'VITE_',
}: UserConfig)

Source from the content-addressed store, hash-verified

107}
108
109export function resolveEnvPrefix({
110 envPrefix = 'VITE_',
111}: UserConfig): string[] {
112 envPrefix = arraify(envPrefix)
113 if (envPrefix.includes('')) {
114 throw new Error(
115 `envPrefix option contains value '', which could lead unexpected exposure of sensitive information.`,
116 )
117 }
118 if (envPrefix.some((prefix) => /\s/.test(prefix))) {
119 // eslint-disable-next-line no-console
120 console.warn(
121 colors.yellow(
122 `[vite] Warning: envPrefix option contains values with whitespace, which does not work in practice.`,
123 ),
124 )
125 }
126 return envPrefix
127}

Callers 3

resolveConfigFunction · 0.90
htmlEnvHookFunction · 0.90
config.spec.tsFile · 0.90

Calls 2

arraifyFunction · 0.90
warnMethod · 0.65

Tested by

no test coverage detected