[英]Error: You may need an appropriate loader to handle this file type - Fusion Js, with using icons
I am writing my first application using Fusion Js and land up into a problem in using icons, for any Font-awesome icons or Material react icons, as soon as I add icons to my template it give me an error我正在使用 Fusion Js 编写我的第一个应用程序并遇到使用图标的问题,对于任何 Font-awesome 图标或 Material react 图标,只要我将图标添加到我的模板中,它就会给我一个错误
''You may need an appropriate loader to handle this file type'' ''你可能需要一个合适的加载器来处理这种文件类型''
import React from 'react';
import {styled} from 'fusion-plugin-styletron-react';
import MaterialIcon, {colorPalette} from 'material-icons-react';
const TopBar = styled('div',{
height:'30px',
width: '100%',
position:'fixed',
top:'0',
zIndex:'99',
backgroundColor:'#4b4b4b',
display:'flex',
boxShadow:'0px 0px 8px 0px #000000'
});
const Brand = styled('div',{
color:'#ffffff',
});
export default () => (
<TopBar>
<span></span>
<Brand>
<span> Observe Point</span>
</Brand>
<div>
<span></span>
<span><MaterialIcon icon={'search'}></MaterialIcon></span>
</div>
</TopBar>
);
What i know is that, this error usual occurs while bundling, but I am not sure how to fix this.我所知道的是,这个错误通常在捆绑时发生,但我不知道如何解决这个问题。
Need help.需要帮忙。
Fusion.js at this time does not support custom webpack loaders. Fusion.js 目前不支持自定义 webpack loader。 We do have some techniques to load SVGs though, and have documented a strategy here: https://fusionjs.com/docs/guides/svg-react-components
不过,我们确实有一些技术来加载 SVG,并在此处记录了一个策略: https : //fusionjs.com/docs/guides/svg-react-components
I'd love to find a way to be more compatible with material-ui though, so perhaps we can look at implementing a fusion-plugin-material-icons or similar in the future.不过,我很想找到一种与 material-ui 更兼容的方法,所以也许我们可以考虑在未来实现 fusion-plugin-material-icons 或类似的东西。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.