eject在webpack中支持直接引入svg
{
loader: require.resolve('file-loader'),
// Exclude `js` files to keep "css" loader working as it injects
// its runtime that would otherwise be processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
// 下面加一个svg的匹配/\.svg$/
exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/, /\.svg$/],
options: {
name: 'static/media/[name].[hash:8].[ext]',
},
},
本文标题:eject在webpack中支持直接引入svg
本文链接:https://www.haomeiwen.com/subject/likrqktx.html
网友评论