Using CopyWebpackPlugin, I'm trying to copy a file with a specific version in the name (e.g. "calcitemaps-arcgis-support-v0.9.js", "otherlibaray-v0.9.js") to my output directory, but stripping the version ("-v0.9) from the filename.
Using the test and toType options, I would think that
{
from: './node_modules/calcite-maps/dist/js/dojo/*0.9*',
to: './calcite/[1].[ext]',
toType: 'template',
flatten: true,
test: /(.*(?=-))\.js/
}
should work, but all I'm getting in my destination directory is a file called [1].js.
I also tried /.*(?=-)\.js/
, /(.*(?=-))/
, and /.*(?=-)/
, none of them worked...
RegEx is obviously not my strong suit here - can anyone help?