When specifying an absolute path as dest, the file is not copied to the specified directory, but rather to a subdirectory of dist with 'the same name'. For example, with the following config:
plugins: [
viteStaticCopy({
hook: 'generateBundle',
targets: [
{
src: path.join(import.meta.dirname, 'foo', 'foo.txt'),
dest: path.join(import.meta.dirname, 'bar'),
rename: { stripBase: true },
},
],
}),
],
The file 'foo.txt' for a project located in /home/user/my-repo/foo/foo.txt will be copied to /home/user/my-repo/dist/home/user/my-repo/bar/foo.txt rather than /home/user/my-repo/bar/foo.txt.
This is a regression when compared to v3.
When specifying an absolute path as
dest, the file is not copied to the specified directory, but rather to a subdirectory ofdistwith 'the same name'. For example, with the following config:The file
'foo.txt'for a project located in/home/user/my-repo/foo/foo.txtwill be copied to/home/user/my-repo/dist/home/user/my-repo/bar/foo.txtrather than/home/user/my-repo/bar/foo.txt.This is a regression when compared to v3.