139
rated 0 times
[
143]
[
4]
/ answers: 1 / hits: 8760
/ 3 Years ago, sun, january 17, 2021, 12:00:00
Suppose I had the following webpack.config.js file:
module.exports = {
//...
output: {
filename: "[name].bundle.js",
path: path.resolve(__dirname, "dist"),
assetModuleFilename: "assets/[name][ext]",
},
module: {
rules: [
{
test: /.(woff|woff2|eot|ttf|otf)$/i,
type: "asset/resource",
},
{
test: /.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
},
],
},
plugins: [
//...
],
};
My question is how can I separate the fonts from the images? I want to put each one in a subdirectory called "fonts" and "images" under the assets folder. I know this is possible using the "file-loader". However, I want to use the asset module.
More From » webpack