vite-plugin-static-copy weekly downloads statistics
By sapphi-red · npm · Vite plugins
rollup-plugin-copy for vite with dev server support.
vite-plugin-static-copy has 3,231,342 recorded weekly downloads on npm, an increase of 6.5% over the past 30 days, ranking #193 of 3,247 tracked listings.
About vite-plugin-static-copy
vite-plugin-static-copy
rollup-plugin-copy for Vite with dev server support.
[!NOTE] Before you use this plugin, consider using public directory or
importin JavaScript. In most cases, these will work.
Install
npm i -D vite-plugin-static-copy # yarn add -D vite-plugin-static-copy
Usage
Add viteStaticCopy plugin to vite.config.js / vite.config.ts.
// vite.config.js / vite.config.ts
import { viteStaticCopy } from 'vite-plugin-static-copy'
export default {
plugins: [
viteStaticCopy({
targets: [
{
src: 'bin/example.wasm',
dest: 'wasm-files',
rename: { stripBase: 1 }, // strips `bin/`
},
],
}),
],
}
For example, if you use the config above, you will be able to fetch bin/example.wasm with fetch('/wasm-files/example.wasm').
So the file will be copied to dist/wasm-files/example.wasm.
[!WARNING]
If you are using Windows, make sure to use
normalizePathafter doingpath.resolveor else.\is a escape charactor intinyglobbyand you should use/.import { normalizePath } from 'vite' import path from 'node:path' normalizePath(path.resolve(__dirname, './foo')) // C:/project/foo // instead of path.resolve(__dirname, './foo') // C:\project\foo
Options
See options.ts.
Debug
You can enable detailed logging by setting the DEBUG environment variable:
DEBUG=vite:plugin-static-copy npm run dev
When debug logging is enabled, the plugin will output which file is served from each URL.
Differences with rollup-plugin-copy
- Faster dev server start-up than using
rollup-plugin-copyonbuildStarthook.- Files are not copied and served directly from the server during dev to reduce start-up time.
destis relative tobuild.outDir.- If you are going to copy files outside
build.outDir, you could userollup-plugin-copyinstead. Because that does not require dev server support.
- If you are going to copy files outside
tinyglobbyis used instead ofglobby.- Because
tinyglobbyis used insidevite.
- Because
transformcould returnnullas a way to tell the plugin not to copy the file, this is similar to the CopyWebpackPlugin#filter option, but it expectstransformto return the original content in case you want it to be copied.transformcan optionally be an object, with ahandlerproperty (with the same signature of therollup-plugin-copytransform option) and anencodingproperty (BufferEncoding | 'buffer') that will be used to read the file content so that thehandler's content argument will reflect the correct encoding (could be Buffer);- Directory structure is always preserved in the output (similar to
flatten: falseinrollup-plugin-copy). Userename: { stripBase: true }for flat copy.
Description from the npm listing.
- vite
- vite-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Vite plugins plugins
All 20 vite-plugin-static-copy alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/vite-plugin-static-copy. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.