# What changed in vite-plugin-static-copy

> 16 changes in vite-plugin-static-copy 3 to 4 from its official release notes, upgrade guides and advisories: 5 breaking, 4 new APIs and options. Each one cited. Sources checked 2026-10-18. HTML: https://unstale.sh/npm/vite-plugin-static-copy/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## vite-plugin-static-copy 4

### Breaking changes

- Glob patterns now match only files, not directory entries; matching directories no longer recursively copy their contents. (4.0.0) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%404.0.0)
- Node 18, 20, 21, and 23 are no longer supported; the new support range is `^22.0.0 || >= 24.0.0`. (4.0.0) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%404.0.0)
- The `structured` option has been removed; use `rename: { stripBase: true }` to flatten output paths when needed. (4.0.0) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%404.0.0)
- Support for Vite 5 has been dropped. (4.0.0) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%404.0.0)

### New APIs and options

- Rename functions can return a RenameObject containing name and stripBase, instead of being limited to strings, making dynamic output paths easier to control declaratively. (4.1.0) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%404.1.0)
- The rename object form accepts name to replace the file's basename; it can be combined with stripBase to flatten directories and rename in one step. (4.1.0) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%404.1.0)

### Behavior and default changes

- Directory structure is now always preserved in the output. (4.0.0) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%404.0.0)
- Directory patterns such as `src: 'assets'` now automatically expand to match all files inside the directory. (4.0.0) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%404.0.0)

### Fixes and other changes

- Static assets are copied using each environment's resolved build.outDir, preventing files from going to the wrong folder in multi-environment setups. (4.1.1) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%404.1.1)
- Absolute dest paths are no longer converted to relative paths when the source has a directory component, so files are copied to the specified absolute path. (4.0.1) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%404.0.1)
- stripBase now handles ../ paths correctly instead of counting .. as directory segments and producing incorrect output paths. (4.0.1) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%404.0.1)

## vite-plugin-static-copy 3

### Breaking changes

- Copying now occurs only for the client environment. (3.1.5) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%403.1.5)

### New APIs and options

- The rename option accepts an object with stripBase to remove a specified number of leading directory segments from the matched path. (3.4.0) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%403.4.0)
- Adds an option to configure which environment the plugin runs in; defaults to 'client'. (3.2.0) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%403.2.0)

### Tooling

- Vite 8 is added to the peer dependency range, allowing projects using Vite 8 to use the plugin. (3.3.0) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%403.3.0)

### Fixes and other changes

- Non-client environments are skipped only when multiple environments exist. (3.1.6) — [release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases/tag/vite-plugin-static-copy%403.1.6)
