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.52k stars 1.82k forks source link

doesn't invoke a custom webpack config function #315

Closed nksfrank closed 10 months ago

nksfrank commented 1 year ago

trying to set up size-limit and use my webpack.config.js that exports a function for building the webpack config object.

size-limit doesn't seem to accept a webpack config as a function.

const clientConfig = (argv, env) => ({
  mode: env.mode,
  devtool: env.mode === 'production' ? 'source-map' : 'eval',
  name: 'client',
  /* ... */
});

console.log('file is read');
module.exports = (argv, env) => {
  console.log('function is invoked', argv, env);
  return clientConfig(argv, env);
};

the function is invoked is never printed

ai commented 1 year ago

Yes, it doesn’t.

Send PR if you have an idea how to add support.

ai commented 10 months ago

The fix was released in 10.0.2.