Skip to content

yuuuuuyu/vite-plugin-cleaned

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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')
          }
        }
    })
  ]
})

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published