serverless-webpack icon indicating copy to clipboard operation
serverless-webpack copied to clipboard

Individual packaging, dynamic config per compile step

Open tom2strobl opened this issue 1 year ago • 0 comments

Description

When packaging individually, the same webpack.config.js is applied to all slsw.lib.entries, when trying to leverage CopyWebpackPlugin, or in my case @sentry/webpack and I have 40 functions, then it uploads (40*40) 1600 sourcemaps to sentry.

In https://github.com/serverless-heaven/serverless-webpack/issues/333#issuecomment-370525373 there was a discussion that there's no way around it, but it's been 5 years and in the meantime I'm curious if somebody found a way?

Afaik webpacks MultiCompiler always compiles sequentially and not in parallel. Since we have a static map of entries (slsw.lib.entries) we know how many compile jobs there are.

There's the before:webpack:compile hook I guess, but I'm not sure if one can change the webpackConfig path dynamically mid-flight?

Is there something I missed?

tom2strobl avatar May 30 '23 09:05 tom2strobl