url-loader

{
// 图片加载器,雷同file-loader,更适合图片,可以将较小的图片转成base64,减少http请求
// 如下配置,将小于8192byte的图片转成base64码
test: /.(png|jpg|gif)$/,
loader: 'url-loader?limit=8192&name=./static/img/[hash].[ext]',
},

  {
                test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
                loader: 'url-loader',
                options: {
                    limit: 10000,
                    name: 'img/[name].[hash:7].[ext]'
                }
            },

你可能感兴趣的:(url-loader)