( chainableConfig = resolveChainableConfig(), )
| 219 | * @param chainableConfig Optional chain config to use. |
| 220 | */ |
| 221 | export function resolveConfig( |
| 222 | chainableConfig = resolveChainableConfig(), |
| 223 | ): webpack.Configuration { |
| 224 | if (!hasInitialized) { |
| 225 | throw error('resolveConfig() must be called after init()'); |
| 226 | } |
| 227 | |
| 228 | let config = chainableConfig.toConfig(); |
| 229 | |
| 230 | // this applies webpack merges |
| 231 | webpackMerges.forEach((mergeFn) => { |
| 232 | if (typeof mergeFn === 'function') { |
| 233 | // mergeFn is a function with optional return value |
| 234 | const res = mergeFn(config, env); |
| 235 | if (res) config = merge(config, res); |
| 236 | } else if (mergeFn) { |
| 237 | // mergeFn is a literal value (object) |
| 238 | config = merge(config, mergeFn); |
| 239 | } |
| 240 | }); |
| 241 | |
| 242 | // return a config usable by webpack |
| 243 | return config; |
| 244 | } |
nothing calls this directly
no test coverage detected