ai / size-limit

Calculate the real cost to run your JS app or lib to keep good performance. Show error in pull request if the cost exceeds the limit.
MIT License
6.54k stars 1.82k forks source link

Add support for webpack config defined as function #339

Closed lev875 closed 11 months ago

lev875 commented 11 months ago

Fixes issue #315

The loadConfig function is deliberately made async, so:

  1. If the custom webpack config function returns a promise — it is resolved and the result is passed to webpack.
  2. 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.