CC 4.0 License
The content of this section is derived from the content of the following links and is subject to the CC BY 4.0 license.
The following contents can be assumed to be the result of modifications and deletions based on the original contents if not specifically stated.
Module
Used to decide how to handle different types of modules in a project.
- Type:
Object - Default:
{}
module.defaultRules
- Type:
(Rule | Falsy)[]
defaultRules configures the built-in module resolution and processing rules that Rspack enables by default. These rules are applied automatically to ensure that common resource types such as JavaScript, JSON, CSS, and Wasm can be correctly resolved and bundled.
You can extend, override, or disable these default rules to gain finer control over the build behavior.
For example, extending the default rules:
If you want to remove all of Rspack's default rules, simply omit "...":
See the source code for the full list of default rules.
module.generator
- Type:
Object - Default:
{}
Use module.generator to define output generation options for each module type, such as asset filenames, public paths, and CSS Modules exports. See Module Generator for details.
module.noParse
- Type:
string | string[] | RegExp | RegExp[] | ((request: string) => boolean) - Default:
undefined
Keep module mechanism of the matched modules as-is, such as module.exports, require, import.
It's useful and can boost build performance when used to ignore libraries without external dependencies.
Note: these modules will still be processed by configured loaders.
module.parser
- Type:
Object - Default:
{}
Use module.parser to define parser options for each module type, such as dependency collection and how module syntax is interpreted. See Module Parser for details.
module.rules
See Module Rules for details.

