[x] Added support for custom webpack config defined as function
[x] Added support for custom webpack config defined as promise
[x] Added tests for both cases
[x] cjs config
[x] esm config
The loadConfig function is deliberately made async, so:
If the custom webpack config function returns a promise — it is resolved and the result is passed to webpack.
If the custom webpack config is an object, or it is a synchronous function — the await statement has no effect and the resulting object is passed as is.
Fixes issue #315
The
loadConfig
function is deliberately made async, so: