问题描述
Webpack.config
const path = require('path')
const HTMLWebpackPlugin = require('html-webpack-plugin')
const HTMLWebpackPluginConfig = new HTMLWebpackPlugin({
template: path.resolve(__dirname,'./public/index.html'),filename: 'index.html',inject: 'body',})
module.exports = {
entry: path.join(__dirname,'index.web.js'),output: {
filename: 'bundle.js',path: path.join(__dirname,'/build'),},resolve: {
alias: {
'react-native$': 'react-native-web','@storybook/react-native': '@storybook/react','styled-components/native': 'styled-components',module: {
rules: [
{
test: /\.(js|jsx|ts|tsx)$/,exclude: /node_modules[/\\](?!react-native-super-grid)/,use: {
loader: 'babel-loader',options: {
// disable reading babel configuration
babelrc: false,configFile: false,presets: [
'@babel/preset-env','@babel/preset-react','@babel/preset-flow','@babel/preset-typescript',{
plugins: ['@babel/plugin-proposal-class-properties','@babel/plugin-proposal-object-rest-spread'],],{
test: /\.(jpg|png|woff|woff2|eot|ttf|svg)$/,loader: 'file-loader',//include: path.resolve(__dirname,"node_modules/react-native-vector-icons"),include: path.resolve(
__dirname,'node_modules/react-native-vector-icons/FontAwesome.js',),}
],plugins: [HTMLWebpackPluginConfig],devServer: {
historyApiFallback: true,contentBase: './',hot: true,}
我正在使用 react-native web
实现故事书,其中我使用 react-native-vector-icons
作为图标,如上图所示,我无法显示图标。
我认为这是一个 webpack
问题(上面的代码)。
你能帮我理解我错在哪里吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)