rspack icon indicating copy to clipboard operation
rspack copied to clipboard

[Feature]: Module.parser.asset.dataUrlCondition support function

Open GiveMe-A-Name opened this issue 11 months ago • 3 comments

What problem does this feature solve?

Currently, Rspack config.module.parser.asset.dataUrlCondition only support object. We can't compute the dataUrlCondition.maxSize by function.

What does the proposed API of configuration look like?

Align webpack, Module.parser.asset.dataUrlCondition support function.

module.exports = {
  module: {
    parser: {
      asset: {
        dataUrlCondition: (source, { filename, module }) => {
          return condition(source)
        }
      },
    },
  },
};

GiveMe-A-Name avatar Nov 20 '24 09:11 GiveMe-A-Name