'auto'
Whether to clean up all files under the output directory before the build starts, the output directory is the value of output.distPath.root.
The default value of output.cleanDistPath
is 'auto'
:
false
, Rsbuild will not perform cleanup.You can set cleanDistPath
to true
to force it to be enabled, or set it to false
to force it to be disabled.
If you only need to clean files in production mode, but not in development mode, you can configure it as:
output.cleanDistPath
supports configuration as an object to achieve more granular control.
boolean | 'auto'
'auto'
Whether to clean up all files under the output directory before the build starts.
RegExp[]
undefined
Specify the files to keep in the output directory. If the file's absolute path matches the regular expression in keep
, the file will not be removed.
For example, to keep the dist/foo.json
file: