@@ -8,7 +8,7 @@ Populate your environment at **runtime** rather than **build time**.
88- Static site generation support.
99- ` .env ` support during development, just like [ Next.js] [ nextjs-env-vars-order ] .
1010
11- ### The problem 🤔
11+ ### Why we created this package 🤔
1212
1313[ Build once, deploy many] [ build-once-deploy-many-link ] is an essential principle
1414of software development. The main idea is to use the same bundle for all
@@ -19,21 +19,24 @@ is also part of the [twelve-factor methodology][twelve-factor-link]. As crucial
1919as it is, it has yet to receive significant support in the world of front-end
2020development, and Next.js is no exception.
2121
22- Next.js supports [ environment variables] [ nextjs-env-vars ] , but only at
22+ Next.js does support [ environment variables] [ nextjs-env-vars ] , but only at
2323build time. This means you must rebuild your app for each target environment,
2424which violates the principle. But what if you want, or need, to follow the build
2525once, deploy many principle?
2626
27- ### The solution 🤓
27+ ### This package 🤓
2828
29- ` next-runtime-env ` solves this problem by generating a JavaScript file that is
30- loaded by the browser and contains the environment variables. We generate this
31- file at runtime, so you don't have to declare your environment variables at
32- build time.
29+ ` next-runtime-env ` solves this problem by generating a JavaScript file that
30+ contains the environment variables at runtime, so you no longer have to declare
31+ your environment variables at build time. This file is loaded in the client,
32+ safely exposing those variables to the browser. This allows you to follow the
33+ build once, deploy many principle by providing differed runtime variables to the
34+ same build.
35+
36+ ### Compatibility 🤝
3337
3438Our approach is compatible with
35- [ static site generation] [ static-generation-link ] , and it also supports
36- middleware.
39+ [ static site generation] [ static-generation-link ] and supports middleware.
3740
3841### Getting started 🚀
3942
0 commit comments