Rspeedy logo
Rspeedy

Home > @lynx-js/rspeedy > Output > cleanDistPath

Output.cleanDistPath property

The Output.cleanDistPath option determines whether all files in the output directory (default: dist) are removed before the build starts.

Signature:

cleanDistPath?: boolean | undefined;

Default Value

Automatically enabled when output.distPath.root is a subdirectory of the project root; otherwise disabled.

Example 1

  • Disable cleaning files:
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  output: {
    cleanDistPath: false,
  },
})

Example 2

  • Only clean files before the production build:
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  output: {
    cleanDistPath: process.env.NODE_ENV === 'production',
  },
})
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.