A utility to copy files and directories.
Partially compatible with rollup-plugin-copy.
Install this package as a dependency in the project:
# npm
npm i rolldown-plugin-copy
# Yarn
yarn add rolldown-plugin-copy
# pnpm
pnpm add rolldown-plugin-copy
# Deno
deno add npm:rolldown-plugin-copy
# Bun
bun add rolldown-plugin-copyAdd the plugin into the Vite config:
import { defineConfig } from "vite";
import { copy } from "rolldown-plugin-copy";
export default defineConfig({
plugins: [
copy({
targets: [
{
src: "./public/index.html",
dest: "./dist/public",
},
{
src: [
"./public/static/css/light.css",
"./public/static/css/dark.css",
],
dest: "./dist/public/static/css",
},
{
src: "./public/static/images/**/*",
dest: "./dist/public/static/images",
},
],
}),
],
});For contributing, please refer to the contributing guide.
This project is inspired by:
- rollup-plugin-copy, created by Vlad Shcherbin.
This project is licensed under the terms of the MIT license.