unstale

npm / vite-plugin-static-copy

vite-plugin-static-copy

What changed in vite-plugin-static-copy 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.

5 breaking4 new APIs and options2 behavior and defaults1 tooling4 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

vite-plugin-static-copy 411 changes

Breaking changes 4

  • Glob patterns now match only files, not directory entries; matching directories no longer recursively copy their contents.

    4.0.0release notes

  • Node 18, 20, 21, and 23 are no longer supported; the new support range is ^22.0.0 || >= 24.0.0.

    4.0.0release notes

  • The structured option has been removed; use rename: { stripBase: true } to flatten output paths when needed.

    4.0.0release notes

  • Support for Vite 5 has been dropped.

    4.0.0release notes

New APIs and options 2

  • 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.0release notes

  • 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.0release notes

Behavior and default changes 2

  • Directory structure is now always preserved in the output.

    4.0.0release notes

  • Directory patterns such as src: 'assets' now automatically expand to match all files inside the directory.

    4.0.0release notes

Fixes and other changes 3

  • 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.1release notes

  • 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.1release notes

  • stripBase now handles ../ paths correctly instead of counting .. as directory segments and producing incorrect output paths.

    4.0.1release notes

vite-plugin-static-copy 35 changes

Breaking changes 1

  • Copying now occurs only for the client environment.

    3.1.5release notes

New APIs and options 2

  • The rename option accepts an object with stripBase to remove a specified number of leading directory segments from the matched path.

    3.4.0release notes

  • Adds an option to configure which environment the plugin runs in; defaults to 'client'.

    3.2.0release notes

Tooling 1

  • Vite 8 is added to the peer dependency range, allowing projects using Vite 8 to use the plugin.

    3.3.0release notes

Fixes and other changes 1

  • Non-client environments are skipped only when multiple environments exist.

    3.1.6release notes