preact-cli-plugin-env-vars
Consume variables in your environment with the Preact CLI.
Installation
$ npm i -D preact-cli-plugin-env-vars
And include in your project by creating a preact.config.js
:
; { ;}
Usage
The plugin allows to use any environment variables prefixed with PREACT_APP_
to be used within your script:
console;
The environment variables are embedded during the build time.
.env
Adding development Environment Variables in To define permanent environment variables, create a file called .env
in the root of your project:
PREACT_APP_SECRET_CODE=abcdef
These variables will act as the defaults if the machine does not explicitly set them. Please refer to the dotenv documentation for more details.
License
MIT © Robin van der Vleuten