YJDH-813 | All frontends: Fix use of env vars in /frontend/next.config.js#3905
YJDH-813 | All frontends: Fix use of env vars in /frontend/next.config.js#3905karisal-anders wants to merge 1 commit intomainfrom
/frontend/next.config.js#3905Conversation
TL:DR; ``` In /frontend/next.config.js: 1. Move env var readings inside nextConfig function 2. Handle overriding env vars gracefully 3. Remove unnecessary withPlugins / next-compose-plugins ``` Done: - Move all readings of env vars from module level to inside the nextConfig function so that the environment variables set in the applications' next.config.js files using dotenv are in use when the env vars' values are evaluated. - Destructure `env` from nextConfig's input and spread it into `env` key in nextConfig function's return value, so the `env` override is combined with the APP_NAME, APP_VERSION and BUILD_TIME settings rather than removing/overriding them directly as was the case with the `override` parameter before. Spread the rest of the nextConfigs input as previously. - Remove withPlugins and next-compose-plugins as unnecessary as the used plugins were always empty. The next-compose-plugins package was last published on npm 5 years ago, so all the more reason to get rid of it. refs YJDH-813
|
YJDH-KESASETELI-API branch is deployed to platta: https://yjdh-kesaseteli-pr3905.api.dev.hel.ninja 🚀🚀🚀 |
|
|
|
YJDH-HELSINKILISA-API branch is deployed to platta: https://helsinkilisa-pr3905.api.dev.hel.ninja 🚀🚀🚀 |
|
HANDLER branch is deployed to platta: https://kesaseteli-handler-ui-pr3905.dev.hel.ninja 🚀🚀🚀 |
|
YOUTH branch is deployed to platta: https://nuortenkesaseteli-pr3905.dev.hel.ninja 🚀🚀🚀 |
|
HANDLER branch is deployed to platta: https://helsinkilisa-ui-handler-pr3905.dev.hel.ninja 🚀🚀🚀 |
|
EMPLOYER branch is deployed to platta: https://kesaseteli-pr3905.dev.hel.ninja 🚀🚀🚀 |
TestCafe result is success for https://kesaseteli-handler-ui-pr3905.dev.hel.ninja 😆🎉🎉🎉 |
TestCafe result is success for https://nuortenkesaseteli-pr3905.dev.hel.ninja 😆🎉🎉🎉 |
TestCafe result is success for https://kesaseteli-pr3905.dev.hel.ninja 😆🎉🎉🎉 |
|
APPLICANT is deployed to platta: https://helsinkilisa-ui-pr3905.dev.hel.ninja 🚀🚀🚀 |
TestCafe result is success for https://helsinkilisa-ui-handler-pr3905.dev.hel.ninja 😆🎉🎉🎉 |
TestCafe result is success for https://helsinkilisa-ui-pr3905.dev.hel.ninja 😆🎉🎉🎉 |



Description ✨
All frontends: Fix use of env vars in
/frontend/next.config.jsTL:DR;
Done:
envfrom nextConfig's input and spread it intoenvkey in nextConfig function's return value, so theenvoverride is combined with the APP_NAME, APP_VERSION and BUILD_TIME settings rather than removing/overriding them directly as was the case with theoverrideparameter before. Spread the rest of the nextConfigs input as previously.refs YJDH-813
Issues 🐛
Testing ⚗️
Screenshots 📸
Additional notes 🗒️