I'm looking to access the environment configuration from next.config.js
in order to utilize some environment variables specified in .env.local and establish server runtime configurations based on them.
Is it appropriate to use next.config.js
for this purpose?
const { loadEnvConfig } = require("@next/env");
const env = loadEnvConfig(".").combinedEnv;
Although this method works, I haven't been able to find any documentation explaining how to achieve this or if it's a supported package/API.