env-create-react-app

1.1.1 • Public • Published

env-create-react-app Build Status

For those using create-react-app wishing to refrence their .env file variables without the REACT_APP prefix.

Usage

.env file

REACT_APP_MY_ENVIRONMENT_VARIABLE_A=foo
REACT_APP_MY_ENVIRONMENT_VARIABLE_B=bar

Example

import {
    MY_ENVIRONMENT_VARIABLE_A,
    MY_ENVIRONMENT_VARIABLE_B
} from 'env-create-react-app';

console.log(MY_ENVIRONMENT_VARIABLE_A);
console.log(MY_ENVIRONMENT_VARIABLE_B);

Output

foo
bar

/env-create-react-app/

    Package Sidebar

    Install

    npm i env-create-react-app

    Weekly Downloads

    4

    Version

    1.1.1

    License

    ISC

    Unpacked Size

    2.4 kB

    Total Files

    6

    Last publish

    Collaborators

    • alexandercollins