unstale

npm / vite-plugin-static-copy

vite-plugin-static-copy

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

9 breaking4 new APIs and options2 behavior and defaults1 tooling5 fixes and other

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

npx @unstale/cli init

@unstale/cli 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

vite-plugin-static-copy 21 changes

Breaking changes 1

vite-plugin-static-copy 14 changes

Breaking changes 3

  • The CJS build was dropped; users need to migrate from CJS to ESM.

    1.0.0release notes

  • Support for Node.js 14.18, 16, 17, and 19 was dropped.

    1.0.0release notes

  • Support for Vite 3 and 4 was dropped.

    1.0.0release notes

Fixes and other changes 1

  • Files are copied only once, even when multiple bundles are generated.

    1.0.0release notes