Skip to content

Copies to absolute dest path no longer work with v4 #241

@jnoordsij

Description

@jnoordsij

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions