Webapck URL加载器和TS2307:找不到模块'image.svg'

时间:2019-06-21 13:57:04

标签: reactjs webpack

我尝试将图像添加到我的应用中

import { ReactComponent as Logo } from './image.svg'

但出现错误:

webpack.config:

~       {
+         test: /\.(gif|png|jpg|svg)(\?.*$|$)/,
+         use: [
+           {
+             loader: 'url-loader',
+             options: {
+               limit: 8192,
+               name: '[name].[ext]',
+               publicPath: 'images/',
+             },
+           },
+         ],
+       },

0 个答案:

没有答案