Skip to content

Commit fbfd4c9

Browse files
committed
fix: process is not defined
1 parent 035d53c commit fbfd4c9

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

apps/app/rsbuild.config.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@ export default defineConfig({
2727
"@fonts": path.resolve(__dirname, "public/fonts"),
2828
},
2929
define: {
30-
...Object.keys(process.env)
31-
.filter((key) => key.startsWith("PUBLIC_"))
32-
.reduce((acc, key) => {
33-
// @ts-expect-error whatever
34-
acc[`process.env.${key}`] = JSON.stringify(process.env[key]);
35-
return acc;
36-
}, {}),
30+
"process.env": {
31+
...Object.keys(process.env)
32+
.filter((key) => key.startsWith("PUBLIC_"))
33+
.reduce((acc, key) => {
34+
// @ts-expect-error whatever
35+
acc[key] = JSON.stringify(process.env[key]);
36+
return acc;
37+
}, {}),
38+
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
39+
},
3740
},
3841
},
3942
output: {

0 commit comments

Comments
 (0)