nunjucks.default(),
output: {
assetFileNames: ({ name }) => {
if (/\.(gif|jpe?g|png|svg)$/.test(name ?? "")) {
return "assets/images/[name]-[hash][extname]";
}
if (/\.(ttf|otf|fnt|woff|woff2|eot)$/.test(name ?? "")) {
return "assets/fonts/[name]-[hash][extname]";
}
if (/\.css$/.test(name ?? "")) {
return "css/[name]-[hash][extname]";
}
if (/\.js$/.test(name ?? "")) {
return "js/[name]-[hash][extname]";
}
return "assets/[name]-[hash][extname]";
},
},
createHtmlPlugin({
minify: true,
}),