1.0.1 • Published 1 year ago

copy-vite-plugin v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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
1.0.1

1 year ago

1.0.0

1 year ago