[]
Exclude JavaScript or TypeScript files that do not need to be compiled by SWC.
The usage of source.exclude
is similar to source.include, supporting passing in strings or regular expressions to match the module path.
For example:
See source.include to learn more usages.
When both source.include
and source.exclude
are set, source.exclude
has higher priority.
For example, in the following example, although source.include
matches the entire src
directory, JavaScript files in the src/foo
directory will not be compiled by SWC:
source.exclude
is used to specify JavaScript/TypeScript files that do not need to be compiled. This means that these files will not be translated by SWC, but the referenced files will still be bundled into the outputs.
If you want certain files to be excluded and not bundled into the outputs, you can use Rspack's IgnorePlugin.