sapphi-red/vite-plugin-static-copy

Improve `rename` option JSDoc

benzsuankularb opened this issue · 2 comments

Add the ability to transform file structure.

viteStaticCopy({
  targets: [
    {
      src: [
        'node_modules/my-lib/dist/**/*',
      ],
      dest: '.',
      transformStructure: (path) => path.replace('node_modules/my-lib/dist/', '')
    },
  ],
  structured: true,
}),

Won't the rename option work for that?

Ah, I previously saw rename func returning a string,
Not sure what's the return value is expected but thought it was only the filename that could be changed.
So this option should work if rename could recompose the full path here.
We may need some documents for this.