vite-plugin-static-copy
vite-plugin-static-copy copied to clipboard
`transform` support
Hey, thanks for making this plugin, would it support transform (i.e. modify file contents) like rollup-plugin-copy
and CopyWebpackPlugin
?
+1, this is a requirement for me as well as I transform xml to json during build and would like to have this in dev mode as well.
edit: looking at the source for rollup-plugin-copy it seems simple enough to do. I need to finish a project first and might give it a shot afterwards.
https://github.com/vladshcherbin/rollup-plugin-copy/blob/master/src/index.js#L114
This feature will be really very welcome.
Hey @sapphi-red , transform
should support folders and every file inside the folder (maybe skip binary files) should be copied with this transform
. At least that's how CopyWebpackPlugin
works
edit: I need to finish a project first and might give it a shot afterwards.
I ended up using rollup-plugin-copy, works just fine
transform
is supported, should we close this issue? @sapphi-red
Folders are not supported right now
You can use a glob to grab all the folders files, that will work.
any examples?
{
src: 'folder/*',
dest: 'build/folder',
transform: content => content + 'b',
}
└─folder1
│ abc.txt
│ test.png
│ index.js
│
└─folder2
code.js
I want to copy folder1
and transform all js
code, glob
not work.
Error: "transform" option only supports a file