MCPcopy Index your code
hub / github.com/andywer/webpack-blocks / env

Function env

packages/core/lib/env.js:14–24  ·  view source on GitHub ↗

* Applies an array of webpack blocks only if `process.env.NODE_ENV` matches the * given `envName`. If no `NODE_ENV` is set, it will be treated as 'development'. * * @param {string} envName Environment name like 'development', 'production' or 'testing'. * @param {Function[]} configSett

(envName, configSetters)

Source from the content-addressed store, hash-verified

12 * @return {Function}
13 */
14function env(envName, configSetters) {
15 assertConfigSetters(configSetters)
16
17 const currentEnv = process.env.NODE_ENV || 'development'
18
19 if (currentEnv !== envName) {
20 return () => config => config
21 } else {
22 return group(configSetters)
23 }
24}

Callers 2

env.test.jsFile · 0.85

Calls 2

assertConfigSettersFunction · 0.85
groupFunction · 0.85

Tested by

no test coverage detected