Overview
I want to use the svg-sprite-loader package to handle the SVG icon, referring to vue-element-admin/./index.js on Github.
question
I follow the teacher"s tutorial Portal to configure webpack.
.
but found that looking at the default module rules configuration of Laravel-mix (path: node_modules/laravel-mix/src/builder/webpack-rules.js), Line:11-73 has:
rules.push({
// only include svg that doesn"t have font in the path or file name by using negative lookahead
test: /(\.(png|jpe?g|gif)$|^((?!font).)*\.svg$)/,
loaders: [
{
loader: "file-loader",
......
}
]
});
// Add support for loading fonts.
rules.push({
test: /(\.(woff2?|ttf|eot|otf)$|font.*\.svg$)/,
loader: "file-loader",
.....
});
ask for advice
- is there a way to modify only the module.rules based on the original webpack configuration of Laravel-mix?
- or create a new webpack config? that is compatible with the original code without the configuration of laravel-mix