美文网首页
eject在webpack中支持直接引入svg

eject在webpack中支持直接引入svg

作者: sweetBoy_9126 | 来源:发表于2020-07-02 14:49 被阅读0次
{
              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