'auto'
Configure whether to clean all files in the output directory before the build starts. The output directory is the output.distPath.root directory.
The default value of output.cleanDistPath
is 'auto'
:
false
, Rsbuild will not perform cleanup.Set cleanDistPath
to true
to force enable it, or set it to false
to force disable it.
To clean files only in production mode and not in development mode, configure it as:
output.cleanDistPath
supports configuration as an object to achieve more granular control.
boolean | 'auto'
'auto'
Whether to clean up all files in 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: