diff --git a/.gitignore b/.gitignore index 4d2ac93af737ea..7c378be1c2bccb 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ TODOs.md temp explorations .idea +*.local \ No newline at end of file diff --git a/playground/.env b/playground/.env index 0dc3d5b88c9e79..aea26e65bca980 100644 --- a/playground/.env +++ b/playground/.env @@ -1 +1,2 @@ CUSTOM_ENV_VARIABLE=9527 +EFFECTIVE_MODE_FILE_NAME=.env \ No newline at end of file diff --git a/playground/.env.development b/playground/.env.development new file mode 100644 index 00000000000000..36eb9202fadce6 --- /dev/null +++ b/playground/.env.development @@ -0,0 +1 @@ +EFFECTIVE_MODE_FILE_NAME=.env.development \ No newline at end of file diff --git a/playground/.env.production b/playground/.env.production new file mode 100644 index 00000000000000..19afb2f7133443 --- /dev/null +++ b/playground/.env.production @@ -0,0 +1 @@ +EFFECTIVE_MODE_FILE_NAME=.env.production \ No newline at end of file diff --git a/playground/TestEnv.vue b/playground/TestEnv.vue index 8b8461a9670fba..561bd30e63413b 100644 --- a/playground/TestEnv.vue +++ b/playground/TestEnv.vue @@ -3,9 +3,12 @@

process.env.NODE_ENV: {{ NODE_ENV }}

-

+

process.env.CUSTOM_ENV_VARIABLE: {{ CUSTOM_ENV_VARIABLE }}

+

+ process.env.EFFECTIVE_MODE_FILE_NAME: {{ EFFECTIVE_MODE_FILE_NAME }} +

\n` diff --git a/test/test.js b/test/test.js index b7505ccd934a2f..5dfc47453695fd 100644 --- a/test/test.js +++ b/test/test.js @@ -96,7 +96,7 @@ describe('vite', () => { expect(await getText('.node-env')).toMatch( `process.env.NODE_ENV: ${isBuild ? 'production' : 'development'}` ) - expect(await getText('.customize-env-variable')).toMatch( + expect(await getText('.custom-env-variable')).toMatch( 'process.env.CUSTOM_ENV_VARIABLE: 9527' ) })