Gathering detailed insights and metrics for @brunoimbrizi/vite-plugin-static-copy
Gathering detailed insights and metrics for @brunoimbrizi/vite-plugin-static-copy
Gathering detailed insights and metrics for @brunoimbrizi/vite-plugin-static-copy
Gathering detailed insights and metrics for @brunoimbrizi/vite-plugin-static-copy
rollup-plugin-copy with dev server support.
npm install @brunoimbrizi/vite-plugin-static-copy
Typescript
Module System
Min. Node Version
Node Version
NPM Version
62.1
Supply Chain
83.3
Quality
74.4
Maintenance
50
Vulnerability
98.6
License
vite-plugin-static-copy@3.1.0
Updated on Jun 25, 2025
vite-plugin-static-copy@3.0.2
Updated on Jun 14, 2025
vite-plugin-static-copy@3.0.1
Updated on Jun 14, 2025
vite-plugin-static-copy@3.0.0
Updated on May 10, 2025
vite-plugin-static-copy@2.3.1
Updated on Apr 09, 2025
vite-plugin-static-copy@2.3.0
Updated on Feb 28, 2025
TypeScript (98.23%)
JavaScript (1.77%)
Total Downloads
1,161
Last Day
2
Last Week
10
Last Month
17
Last Year
624
MIT License
354 Stars
242 Commits
37 Forks
2 Watchers
1 Branches
19 Contributors
Updated on Jun 26, 2025
Minified
Minified + Gzipped
Latest Version
0.15.0
Package Id
@brunoimbrizi/vite-plugin-static-copy@0.15.0
Unpacked Size
71.64 kB
Size
15.45 kB
File Count
6
NPM Version
9.2.0
Node Version
18.12.1
Published on
May 25, 2023
Cumulative downloads
Total Downloads
4
1
rollup-plugin-copy
for Vite with dev server support.
Note Before you use this plugin, consider using public directory or
import
in JavaScript. In most cases, these will work.
1npm i -D vite-plugin-static-copy # yarn add -D vite-plugin-static-copy
Add viteStaticCopy
plugin to vite.config.js
/ vite.config.ts
.
1// vite.config.js / vite.config.ts 2import { viteStaticCopy } from 'vite-plugin-static-copy' 3 4export default { 5 plugins: [ 6 viteStaticCopy({ 7 targets: [ 8 { 9 src: 'bin/example.wasm', 10 dest: 'wasm-files' 11 } 12 ] 13 }) 14 ] 15}
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
normalizePath
after doingpath.resolve
or else.\
is a escape charactor infast-glob
and you should use/
.1import { normalizePath } from 'vite' 2import path from 'node:path' 3 4normalizePath(path.resolve(__dirname, './foo')) // C:/project/foo 5 6// instead of 7path.resolve(__dirname, './foo') // C:\project\foo
See
fast-glob
documentation about this for more details.
See options.ts.
rollup-plugin-copy
rollup-plugin-copy
on buildStart
hook.
dest
is relative to build.outDir
.
build.outDir
, you could use rollup-plugin-copy
instead. Because that does not require dev server support.fast-glob
is used instead of globby
.
fast-glob
is used inside vite
.transform
could return null
as a way to tell the plugin not to copy the file, this is similar to the CopyWebpackPlugin#filter option, but it expects transform
to return the original content in case you want it to be copied.transform
can optionally be an object, with a handler
property (with the same signature of the rollup-plugin-copy
transform option) and an encoding
property (BufferEncoding | 'buffer'
) that will be used to read the file content so that the handler
's content argument will reflect the correct encoding (could be Buffer);No vulnerabilities found.
No security vulnerabilities found.
Last Day
100%
2
Compared to previous day
Last Week
900%
10
Compared to previous week
Last Month
-32%
17
Compared to previous month
Last Year
64.2%
624
Compared to previous year