diff --git a/frontend/frontend/craco.config.js b/frontend/frontend/craco.config.js index e1d369d5..2bc98b9c 100644 --- a/frontend/frontend/craco.config.js +++ b/frontend/frontend/craco.config.js @@ -22,16 +22,14 @@ module.exports = { net: false, }; - // Turn { KEY: "value" } into { "process.env.KEY": JSON.stringify("value") } - const env = { - myDummyKey: 'myDummyPAT', - }; - const envKeys = Object.keys(env).reduce((prev, next) => { - prev[`process.env.${next}`] = JSON.stringify(env[next]); - return prev; - }, {}); - webpackConfig.plugins.push(new webpack.DefinePlugin(envKeys)); - + // Inject process.env so server code can access PAT_1 + webpackConfig.plugins.push( + new webpack.DefinePlugin({ + 'process.env': { + myDummyKey: JSON.stringify('myDummyPAT'), // <-- your env var + }, + }), + ); return webpackConfig; }, },