Skip to content

Commit daaf38f

Browse files
conico974Nicolas Dorseuil
and
Nicolas Dorseuil
authored
fix NODE_ENV in config file for edge (#864)
Co-authored-by: Nicolas Dorseuil <[email protected]>
1 parent ae1afbb commit daaf38f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/bright-pants-drum.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/aws": patch
3+
---
4+
5+
set process.env.NODE_ENV to production during edge config compilation

packages/open-next/src/build/compileConfig.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,9 @@ export function compileOpenNextConfigEdge(
118118
conditions: ["worker", "browser"],
119119
platform: "browser",
120120
external: externals,
121+
define: {
122+
// with the default esbuild config, the NODE_ENV will be set to "development", we don't want that
123+
"process.env.NODE_ENV": "production",
124+
},
121125
});
122126
}

0 commit comments

Comments
 (0)