When I reference an asset in Webpack 5 it creates a copy of it by default. For example a font file in ./assets/fonts/myfont.woff2 gets copied to ./b27297c148a7ef314ce2.woff2 which is very useful when working with a source and a dist folder. Howerver, I need to use the same asset directory from my source files and the bundled css file. Is there a way to disable the file copying and only update the path to the ressource files according to the destination of the bundled output file?
Update:
I've managed to set the copy destination equal to the source destination of my asset files:
/*webpack.config.js*/
module.exports = {
output: {
assetModuleFilename: '[file]'
},
};
However, this is not ideal as all files get overwritten by themselves.