Just a heads up: this broke our build. We marked fonts to include in the build with side-effect only imports from our code
import "~/assets/my-font.woff"
and as expected, this caused the font not to be copied anymore.
I think there should be extra documentation in https://webpack.js.org/guides/asset-modules mentionning this can be forced using
{
test: /\.(woff|woff2)$/,
generator: {
filename: 'fonts/[name][ext]',
},
type: 'asset/resource',
sideEffects: true,
},
Originally posted by @GerkinDev in #20352 (comment)