source.exclude

Specifies JavaScript/TypeScript files that do not need to be compiled. The usage is consistent with Rule.exclude in Rspack, which supports passing in strings or regular expressions to match the module path.

For example:

import path from 'node:path';

export default {
  source: {
    exclude: [path.resolve(__dirname, 'src/module-a'), /src\/module-b/],
  },
};