|
| 1 | +// eslint-disable-next-line func-names |
1 | 2 | module.exports = function (api) {
|
2 |
| - var validEnv = ['development', 'test', 'production']; |
3 |
| - var currentEnv = api.env(); |
4 |
| - var isDevelopmentEnv = api.env('development'); |
5 |
| - var isProductionEnv = api.env('production'); |
6 |
| - var isTestEnv = api.env('test'); |
| 3 | + const validEnv = ['development', 'test', 'production']; |
| 4 | + const currentEnv = api.env(); |
| 5 | + const isDevelopmentEnv = api.env('development'); |
| 6 | + const isProductionEnv = api.env('production'); |
| 7 | + const isTestEnv = api.env('test'); |
7 | 8 |
|
8 | 9 | if (!validEnv.includes(currentEnv)) {
|
9 | 10 | throw new Error(
|
10 |
| - 'Please specify a valid `NODE_ENV` or ' + |
11 |
| - '`BABEL_ENV` environment variables. Valid values are "development", ' + |
12 |
| - '"test", and "production". Instead, received: ' + |
13 |
| - JSON.stringify(currentEnv) + |
14 |
| - '.' |
| 11 | + `${ |
| 12 | + 'Please specify a valid `NODE_ENV` or ' |
| 13 | + + '`BABEL_ENV` environment variables. Valid values are "development", ' |
| 14 | + + '"test", and "production". Instead, received: ' |
| 15 | + }${JSON.stringify(currentEnv)}.`, |
15 | 16 | );
|
16 | 17 | }
|
17 | 18 |
|
|
0 commit comments