MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / getDotEnvPath

Function getDotEnvPath

packages/webpack5/src/helpers/dotEnv.ts:33–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31}
32
33function getDotEnvPath(): string {
34 const dotEnvPath = resolve(getProjectRootPath(), '.env');
35 const dotEnvWithEnvPath = resolve(getProjectRootPath(), getDotEnvFileName());
36
37 // look for .env.<env>
38 if (existsSync(dotEnvWithEnvPath)) {
39 return dotEnvWithEnvPath;
40 }
41
42 // fall back to .env
43 if (existsSync(dotEnvPath)) {
44 return dotEnvPath;
45 }
46
47 // don't use .env
48 return null;
49}

Callers 1

applyDotEnvPluginFunction · 0.85

Calls 3

getProjectRootPathFunction · 0.90
getDotEnvFileNameFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected