Object | FunctionYou can modify the config of less-loader via tools.less.
When tools.less is configured as Object type, it is merged with the default config through Object.assign in a shallow way. It should be noted that lessOptions is merged through deepMerge in a deep way. For example:
When tools.less is a Function, the default config is passed as the first parameter, which can be directly modified or returned as the final result. The second parameter provides some utility functions that can be called directly. For example:
In some scenarios, if you need to use a specific version of Less instead of the built-in Less v4 in Rsbuild, you can install the desired Less version in your project and set it up using the implementation option of the less-loader.
(excludes: RegExp | RegExp[]) => voidUsed to specify which files less-loader does not compile, You can pass in one or more regular expressions to match the path of less files, for example: