1.0.29 • Published 12 months ago

vite-plugin-cleaned v1.0.29

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

Introduce

用于构建前清理上次构建的产物

Install

pnpm install vite-plugin-clean -D

Usage

import { defineConfig } from 'vite'
import vitePluginClean from 'vite-plugin-clean'

export default defineConfig({
  plugins: [
    vitePluginClean()
  ]
})

API

options

export type PluginOptions = {
  folder: string | string[]
  hooks?: {
    buildStart?: () => void | Promise<void>
    closeBundle?: () => void | Promise<void>
  }
}

example

export default defineConfig({
  plugins: [
    vitePluginClean({
        folder: 'dist', // default: dist or ['dist'] or ['dist', 'lib']
        hooks: {
          buildStart() {
            console.log('build start')
          }
        }
    })
  ]
})
1.0.29

12 months ago

1.0.28

12 months ago

1.0.2

12 months ago