This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

preact-cli-plugin-env-vars

1.2.1 • Public • Published

preact-cli-plugin-env-vars

Consume variables in your environment with the Preact CLI.

NPM version Build Status

Installation

$ npm i -D preact-cli-plugin-env-vars

And include in your project by creating a preact.config.js:

import envVars from 'preact-cli-plugin-env-vars';
 
export default function (config, env, helpers) {
  envVars(config, env, helpers);
}

Usage

The plugin allows to use any environment variables prefixed with PREACT_APP_ to be used within your script:

console.log(process.env.PREACT_APP_SECRET_CODE);

The environment variables are embedded during the build time.

Adding development Environment Variables in .env

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

Readme

Keywords

Package Sidebar

Install

npm i preact-cli-plugin-env-vars

Weekly Downloads

205

Version

1.2.1

License

MIT

Unpacked Size

3.91 kB

Total Files

4

Last publish

Collaborators

  • robinvdvleuten