I would like to know how to use a template to copy files and keep the file directory structure, thanks.
ββββdirectory
β ββββdirectoryA
β β ββββa.js
β β ββββb.js
β ββββc.js
to
ββββdirectory
β ββββdirectoryA
β β ββββa.hash.js
β β ββββb.hash.js
β ββββc.hash.js
ββββdirectory
β ββββa.hash.js
β ββββb.hash.js
β ββββc.hash.js
@lewayjack don't use toType:template, just use glob and set fromArgs needed root directory
@evilebottnawi Sorry I may not express myself clearly.
i'd like to:
fromArgs adds hash value to the file name new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../app/web/assets/lib'),
to: 'lib/[name].[hash].[ext]',
toType: 'template'
}
])
now all files are in the lib folder, not their own subdirectory
@lewayjack maybe related https://github.com/webpack-contrib/copy-webpack-plugin/issues/112 ?
@lewayjack try lib/[path][name].[hash].[ext]
@ioannisNoukakis that works,THX
Most helpful comment
@lewayjack try lib/[path][name].[hash].[ext]