
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@col0ring/vite-plugin-copy
Advanced tools
A vite plugin for copying dirs or files after building.
npm install @col0ring/vite-plugin-copy -D
# or
yarn add @col0ring/vite-plugin-copy -D
import { defineConfig } from 'vite'
import path from 'path'
import viteCopyPlugin from '@col0ring/vite-plugin-copy'
function resolve(relativePath: string) {
return path.resolve(__dirname, relativePath)
}
export default defineConfig({
plugins: [
// ...
viteCopyPlugin([
{
src: resolve('./dist/index.html'),
target: resolve('./dist/index2.html')
}
])
]
})
The src and target options can accept arrays:
import { defineConfig } from 'vite'
import path from 'path'
import viteCopyPlugin from '@col0ring/vite-plugin-copy'
function resolve(relativePath: string) {
return path.resolve(__dirname, relativePath)
}
export default defineConfig({
plugins: [
// ...
viteCopyPlugin([
{
src: resolve('./dist/index.html'),
target: [resolve('./dist/index2.html'), resolve('./dist/index3.html')]
}
])
]
})
import { defineConfig } from 'vite'
import path from 'path'
import viteCopyPlugin from '@col0ring/vite-plugin-copy'
function resolve(relativePath: string) {
return path.resolve(__dirname, relativePath)
}
export default defineConfig({
plugins: [
// ...
viteCopyPlugin([
{
src: [resolve('./dist/index.html'), resolve('./dist/assets')],
target: [resolve('./dist/dist2'), resolve('./dist/dist3')]
}
])
]
})
The disk path supports glob:
import { defineConfig } from 'vite'
import path from 'path'
import viteCopyPlugin from '@col0ring/vite-plugin-copy'
function resolve(relativePath: string) {
return path.resolve(__dirname, relativePath)
}
export default defineConfig({
plugins: [
// ...
viteCopyPlugin([
{
// move all files in the src directory to the target directory
src: resolve('./dist/assets/**/*'),
target: resolve('./dist/assets2')
}
])
]
})
Usually, the plugin will automatically recognize whether the copy is a directory or a file, but you can still specify it manually:
import { defineConfig } from 'vite'
import path from 'path'
import viteCopyPlugin from '@col0ring/vite-plugin-copy'
function resolve(relativePath: string) {
return path.resolve(__dirname, relativePath)
}
export default defineConfig({
plugins: [
// ...
viteCopyPlugin([
{
// this is a file
src: resolve('./dist/file'),
target: {
isDir: false,
path: resolve('./dist/file2')
}
}
])
]
})
function vitePluginCopy(
options: CopyOptions[],
globOptions?: glob.IOptions
): Plugin
srcstring | string[]Resource file or directory.
targetstring | string[] | TargetObject | TargetObject[]Target file or directory.
interface TargetObject {
isDir?: boolean
path: string
}
Custom glob configuration.
FAQs
A vite plugin for copying dirs or files after building.
The npm package @col0ring/vite-plugin-copy receives a total of 129 weekly downloads. As such, @col0ring/vite-plugin-copy popularity was classified as not popular.
We found that @col0ring/vite-plugin-copy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.