-
#251
7672842Thanks @sapphi-red! - Addnameproperty to therenameobject form and allow rename functions to return aRenameObject. Thenameproperty replaces the file's basename (filename + extension), and can be combined withstripBaseto both flatten directory structure and rename the file in one step. Rename functions can now return{ name, stripBase }objects instead of only strings, making it easier to declaratively control output paths from dynamic rename logic.// node_modules/lib/dist/index.js → vendor/lib.js { src: 'node_modules/lib/dist/index.js', dest: 'vendor', rename: { name: 'lib.js', stripBase: true } } // src/pages/events/test.html → dist/events/index.html { src: 'src/pages/**/*.html', dest: 'dist/', rename: { stripBase: 2, name: 'index.html' } }
-
#249
c6bf44cThanks @sapphi-red! - Fix absolutedestpaths being nested under the output directoryWhen
destwas an absolute path and the source file had a directory component (structured output), the path was incorrectly converted to a relative path, causing files to be nested under the build output directory instead of being copied to the specified absolute path.{ src: 'foo/foo.txt', dest: '/home/user/my-repo/bar' }
Before:
/home/user/my-repo/dist/home/user/my-repo/bar/foo/foo.txtAfter:/home/user/my-repo/bar/foo/foo.txt -
#247
d3af79eThanks @sapphi-red! - Fixrename.stripBaseto work correctly with../pathsPreviously,
stripBasecounted..as directory segments, causing incorrect output paths when copying from parent directories.{ src: '../../src/pages/**/*.html', dest: 'dist/', rename: { stripBase: 2 } }
Before:
dist/src/pages/events/test.htmlAfter:dist/events/test.html{ src: '../../src/pages/**/*.html', dest: 'dist/', rename: { stripBase: true } }
Before:
dist/src/pages/events/test.htmlAfter:dist/test.html
-
#235
b2edc86Thanks @sapphi-red! - Simplify glob behavior and always preserve directory structure.Breaking changes:
- Only files are matched. Glob patterns no longer match directory entries. Previously, matching a directory would recursively copy it via
fs.cp, which caused files to be copied twice when using**patterns. - Directory patterns are auto-expanded.
src: 'assets'now automatically expands to match all files inside the directory, using tinyglobby's built-inexpandDirectoriesoption. No migration needed for this pattern alone. structuredoption removed. Directory structure is now always preserved in the output. Thestructuredoption has been removed entirely. Userename: { stripBase: true }to flatten output paths when needed.
- Only files are matched. Glob patterns no longer match directory entries. Previously, matching a directory would recursively copy it via
-
#237
6129008Thanks @sapphi-red! - Drop support for Vite 5 -
#238
9766e42Thanks @sapphi-red! - Drop support for Node 18, 20, 21, 23. The new support range is^22.0.0 || >= 24.0.0.
-
#233
f665a15Thanks @sapphi-red! - Add{ stripBase: number }object form to therenameoption. This strips the given number of leading directory segments from the matched path, avoiding the need for manual../traversals in a rename function.This is useful when copying files from deep paths like
node_modules/my-lib/dist/**/*withstructured: true, where the full directory structure would otherwise be preserved in the output. Instead of writing a rename function that manually returns../traversals to flatten unwanted nesting, you can userename: { stripBase: N }to declaratively strip the leading segments.
- #230
3074e1aThanks @sapphi-red! - Add Vite 8 to peer dependency range.
- #219
fbb2a7aThanks @sapphi-red! - Addenvironmentoption to configure which environment the plugin runs in. Defaults to'client'.
- #217
e3d457dThanks @sapphi-red! - Only skip non-client environments when multiple environments exist.
- #214
3f252ccThanks @sapphi-red! - Only copy for the client environment.
- #204
d0b5370Thanks @stianjensen! - Removedfs-extradependency in favor ofnode:fs. This should not affect the behavior.
- #202
9388186Thanks @sapphi-red! - Switched to use trusted publisher to publish the package.
- #195
0bc6b49Thanks @sapphi-red! - Files not included insrcwas possible to acess with a crafted request. See GHSA-pp7p-q8fx-2968 for more details.
- #186
fc84156Thanks @sapphi-red! - fix a bug that the content was not sent when multiple vite-plugin-static-copy instance was used
- #171
9c7cf2eThanks @MrRefactoring! - add Vite 7 to peer dep range
- #167
89458b2Thanks @sapphi-red! - improved file grouping algorithm for better performance
-
#166
60409c5Thanks @sapphi-red! - fix absolute destination paths in copy targets incorrectly returning contents in dev -
#164
337f976Thanks @sapphi-red! - fixes case-insensitive path conflicts causing copy failures (EEXIST error)
- #150
71f4f5bThanks @sapphi-red! - migratefast-globtotinyglobbyto reduce the package size and to align with Vite. This breaking change should not affect most users. Check Vite's migration guide for more details.
- #152
6aee6a3Thanks @sapphi-red! - improve performance of internalisSubdirectoryOrEqualfunction
281f5b2Thanks @sapphi-red! - improve performance by coping files concurrently when possible
- #149
a9f35c9Thanks @sapphi-red! - ensure.[cm]?[tj]sx?static assets are JS mime to align with Vite. vitejs/vite#19453
- #141
88e513dThanks @sapphi-red! - add Vite 6 to peer dep
- #133
b9c09bdThanks @rschristian! - Allows user to optionally configure when the plugin is ran by passing in a Rollup hook name
- #127
21304dfThanks @tassioFront! - feat: throw an error when does not find file
- #121
d68aec9Thanks @tobz1000! - The value ofContent-Typeheader was inferred and set from the src file extension. It is now infered from the dest file extension.
311ce4dThanks @sapphi-red! - generate provenance statements for the package
- #105
32115f0Thanks @daihuabin! - don't crash when the requested path is mapped to a directory
db73fb5Thanks @sapphi-red! - udpate mrmime to v2. align the used mime values with Vite 5.1. See https://github.com/lukeed/mrmime/releases/tag/v2.0.0 for the difference.
- #79
19b9fcaThanks @sapphi-red! - using absolute path src withstructured: truewas not working. ThefullPathargument in therenameoption will now always be an absolute path, instead of sometimes being a relative path.
-
252f62cThanks @sapphi-red! - drop support for Vite 3 and 4 -
252f62cThanks @sapphi-red! - drop CJS build. See https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for how to migrate from CJS to ESM. -
252f62cThanks @sapphi-red! - drop node 14.18/16/17/19 support
- #67
8707d84Thanks @sapphi-red! - copy only once even if multiple bundles are generated