Techiio-author
Started by Sagar RabidasOct 28, 2021

Open
Change enviroment variables in next after build

5 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 5 VIEWES SHARE

Is there any way to change the environment variables after the build in next?

I want to change the value of an environment variables for test purpose. In that case I want a button . Now, I called a
variable NEXT_PUBLIC_CURRENCY=USD and I want a button for click and change for CAD.

1 Replies

Techiio-commentatorPrince Mishra replied 3 months ago0 likes0 dislikes

It is very simple to change the next env after the build

react-inject-env: a tool which allows you to modify environment variables after the static file has been built The short and simple explanation is that it creates an env.js file in the /public folder. The file is then executed at the start and the variables are loaded into the window object.

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance