Skip to content

guangzan/vite-plugin-ignore-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-ignore-public

NPM version

Ignore public directories at build time

Motivation

When developing with the vite development environment, you may need to use assets under public. If the target of the build does not depend on this part of the assets, ignore some of them at build time and do not copy them to the dist directory. vite will duplicate them by default, and there is no way to turn off this behavior yet, use this plugin to fix it.

Install

npm i -D vite-plugin-ignore-public

Add plugin to your vite.config.ts:

// vite.config.ts
import { IgnorePublicPlugin } from 'vite-plugin-ignore-public'

export default {
  plugins: [
    IgnorePublicPlugin(),
  ]
}

About

Ignore public directories at build time

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published