filemanager-webpack-plugin
filemanager-webpack-plugin copied to clipboard
Something strange while copying file and renaming it
Hi! I'd like to copy a file and rename it, but I get a folder named as the name of source file. The code in document likes that:
copy: [
{ source: "./dist/bundle.js", destination: "./newfile.js" }
]
Then I make it like that:
new FileManagerPlugin({
onEnd: {
copy: [
{
source: path.resolve(__dirname, '../../dist/static/css/app.*.css'),
destination: path.resolve(__dirname, '../../dist/static/css/app.css')
}
]
}
})
I get a folder named app.css, and the source file is copied into this folder. Is there anything wrong in my code? Thank you!

What you have in your config seems fine. I'll try to take a look into this issue
I've encountered the same issue but only when the source contains a pattern instead of a path.
If you are not using a hashed file and you remove the .* from the source attribute it works.
@abczdefg have you ever managed to address this issue?
It works as expected. You cannot copy glob into a file, thats how it works. In your example app.*.css could match more than one file in the path. If there are more than one files by any chance. It can't be copied/merged into a single file. It is copied as it is to the target directory.
And. Yes. I agree, the interpolated file names generated by webpack can't be copied by giving a filename, since the filenames are generated dynamically.
PR's are welcome.