copy-vite-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

copy-vite-plugin

The most simple and easy-to-use vite copy plugin.

use like copy-webpack-plugin

If you are migrating from webpack to vite and looking for an copy plugin, this plugin will be very suitable for you.

Compare the usage of copy-webpack-plugin and copy-vite-plugin:

// webpack.config.js
const CopyPlugin = require('copy-webpack-plugin')

module.exports = {
  plugins: [
    new CopyPlugin({
      patterns: [
        // copy dir
        { from: 'src/images', to: 'images' },
        // copy file
        { from: 'src/constants/info.json', to: 'info.json' }
      ]
    })
  ]
}
// vite.config.ts
import { copy } from 'copy-vite-plugin'

export default defineConfig({
  plugins: [
    copy({
      pattern: [
        // copy dir
        { from: 'src/images', to: 'images' },
        // copy file
        { from: 'src/constants/info.json', to: 'info.json' }
      ]
    })
  ]
})

Install

# npm
npm i copy-vite-plugin -D

# yarn
yarn add copy-vite-plugin -D

# pnpm
pnpm add copy-vite-plugin -D

Readme

Keywords

Package Sidebar

Install

npm i copy-vite-plugin

Weekly Downloads

49

Version

1.0.1

License

MIT

Unpacked Size

14.1 kB

Total Files

5

Last publish

Collaborators

  • wangyulue