[Feature]: Improve `DataCloneError` when invoking loaders in worker
What problem does this feature solve?
Improve DataCloneError when invoking loaders in worker.
What does the proposed API of configuration look like?
N/A
Current error when loader parallel is enabled and the options include a function:
a practical example of parallel loaders in the docs would also be appreciated
such as style-loader -> css-loader -> postcss-loader -> sass-loader sort of chain
which loaders are the current parallel feature compatible with?
I'm seeing errors with no description at all
edit: im also open to the idea that I don't know how to configure this properly, given the documentation
let cssLoaderLoaders = [
process.env.NODE_ENV === 'production' && {
loader: rspack.CssExtractRspackPlugin.loader,
options: {},
// parallel: true,
},
process.env.NODE_ENV !== 'production' &&
!isServer && {
loader: 'style-loader',
options: {},
// parallel: true,
},
{
loader: 'css-loader',
options: {},
// parallel: true,
},
{
loader: 'postcss-loader',
options: {
config: {
path: path.resolve(__dirname, '../../postcss.config.js'),
},
},
// parallel: true,
},
{
loader: 'sass-loader',
options: {
api: 'modern-compiler',
implementation: require.resolve('sass-embedded'),
outputStyle: 'compressed',
},
// parallel: true,
},
].filter(Boolean);
const cssLoader = {
test: /\.s?css$/,
type: 'javascript/auto',
use: cssLoaderLoaders,
};
If I only set parallel: true on postcss-loader, I'll see things like
Only enable on sass-loader
@tim-soft parallel has same limitation as thread-loader which only supports cloneable options, if you use some cloneable options, consider disable parallel for this loader or consider remove non-cloneable props