Using dotenv .env config file correctly

Description

How the .env file and imports should be setup for the project correctly as currently the build is breaking.

Expected behavior

  • add .env file with config in root
  • npm install --save dotenv
  • import dotenv using require('dotenv').config(); or ES6 syntax in index.js file
  • consume using process.env.CONFIG_NAME across application

Actual behavior

screen shot 2016-10-06 at 17 45 24

Using the expected behaviour approach I get the above error. I've also tried both installing dotenv and not installing it (as ejecting the repository shows dotenv is already a dependency).

Environment

react-scripts@0.6.1
node - v6.6.0
npm - 3.10.8

Using a Chrome (53.0.2785.143) on a Mac.