Skip to content
This repository has been archived by the owner on Nov 15, 2017. It is now read-only.

Commit

Permalink
Check if common .env variable is set, otherwise throw error
Browse files Browse the repository at this point in the history
  • Loading branch information
fastner committed Feb 8, 2017
1 parent 07b7953 commit 8082afc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/webpack/ConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,14 @@ function ConfigFactory({ target, mode, root = CWD, ...options })
throw new Error('You must provide a "mode" (development|production) to the ConfigFactory.')
}

if (process.env.CLIENT_BUNDLE_OUTPUT_PATH === undefined)
{
throw new Error(
`No .env file found. Please provide one to your project's root. ` +
`You can use ./node_modules/advanced-boilerplate/.env.example as template`
)
}

process.env.NODE_ENV = options.debug ? "development" : mode
process.env.BABEL_ENV = mode

Expand Down

0 comments on commit 8082afc

Please sign in to comment.