From dac262c8d55a1219c5180b9c7efbe5c07082d3f0 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 10 Dec 2024 17:07:23 +0000 Subject: [PATCH 1/3] set `keepProcessEnv` to `false` and re-enable `react` module-resolution test --- packages/vite-plugin-cloudflare/src/cloudflare-environment.ts | 2 +- .../module-resolution/__tests__/module-resolution.spec.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts b/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts index c4d93fc2..f49e4032 100644 --- a/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts +++ b/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts @@ -179,7 +179,7 @@ export function createCloudflareEnvironmentOptions( ], }, }, - keepProcessEnv: true, + keepProcessEnv: false, }; } diff --git a/playground/module-resolution/__tests__/module-resolution.spec.ts b/playground/module-resolution/__tests__/module-resolution.spec.ts index 3f90891a..836d97cc 100644 --- a/playground/module-resolution/__tests__/module-resolution.spec.ts +++ b/playground/module-resolution/__tests__/module-resolution.spec.ts @@ -76,9 +76,7 @@ describe('module resolution', async () => { * special meaning to us. */ describe('third party packages resolutions', () => { - // TODO: we skip this test on build because a `ReferenceError: process is not defined` is thrown - // (https://github.com/flarelabs-net/vite-plugin-cloudflare/issues/82) - test.skipIf(isBuild)('react', async () => { + test('react', async () => { const result = await getJsonResponse('/third-party/react'); expect(result).toEqual({ '(react) reactVersionsMatch': true, From a00582ba5fe2d13d8d466e24c07be1725b2d0273 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Mon, 16 Dec 2024 15:51:33 +0000 Subject: [PATCH 2/3] remove `keepProcessEnv` altogether --- packages/vite-plugin-cloudflare/src/cloudflare-environment.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts b/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts index f49e4032..b9fe99ac 100644 --- a/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts +++ b/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts @@ -179,7 +179,6 @@ export function createCloudflareEnvironmentOptions( ], }, }, - keepProcessEnv: false, }; } From 6e7c2418808ad19cf50db720937ce6aeb255b9a9 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Mon, 16 Dec 2024 15:56:09 +0000 Subject: [PATCH 3/3] Revert "remove `keepProcessEnv` altogether" This reverts commit a00582ba5fe2d13d8d466e24c07be1725b2d0273. --- packages/vite-plugin-cloudflare/src/cloudflare-environment.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts b/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts index b9fe99ac..f49e4032 100644 --- a/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts +++ b/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts @@ -179,6 +179,7 @@ export function createCloudflareEnvironmentOptions( ], }, }, + keepProcessEnv: false, }; }