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
:
const CopyPlugin = require('copy-webpack-plugin')
module.exports = {
plugins: [
new CopyPlugin({
patterns: [
{ from: 'src/images', to: 'images' },
{ from: 'src/constants/info.json', to: 'info.json' }
]
})
]
}
import { copy } from 'copy-vite-plugin'
export default defineConfig({
plugins: [
copy({
pattern: [
{ from: 'src/images', to: 'images' },
{ from: 'src/constants/info.json', to: 'info.json' }
]
})
]
})
Install
npm i copy-vite-plugin -D
yarn add copy-vite-plugin -D
pnpm add copy-vite-plugin -D