const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
mode: 'development',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './release'),
filename: 'bundle.js',
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './index.html',
}),
],
module: {
rules: [
{
test: /\.(js|jsx)$/,
include: [
path.resolve('src'),
path.resolve('node_modules/react-native-progress'),
path.resolve('node_modules/@react-native-community')
],
use: {
loader: 'babel-loader',
options: {
presets: [
'@babel/preset-env',
'@babel/preset-react',
{
plugins: ['@babel/plugin-proposal-class-properties'],
},
],
plugins: ['babel-plugin-react-native-web'],
},
},
},
],
},
devServer: {
contentBase: path.join(__dirname, 'release'),
compress: true,
port: 4000,
},
resolve: {
alias: {
'react-native$': 'react-native-web',
},
},
};
ERROR in ./node_modules/@react-native-community/art/lib/ARTSerializablePath.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /home/box/dev/rn_web/node_modules/@react-native-community/art/lib/ARTSerializablePath.js: Unexpected token, expected "," (21:27)
19 | // TODO: Refactor to class
20 | const SerializablePath = Class(Path, {
using webpack.config.js