I am trying to fix a plugin but cannot seem to webpack out of the box. it was originally using webpack v2 and babel 6 so i decided to upat it to wepack 4 and babel 7. even so it does not seem to webpack. the error i get is
ERROR in ./src/index.js 42:8
Module parse failed: Unexpected token (42:8)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| if (this.props.image && this.props.imageClass){
| return(
> <img
| src={this.props.image}
| className={this.props.imageClass}
@ multi @babel/polyfill ./src/index.js main[1]
my webpack file is
var path = require('path');
module.exports = {
mode: 'development',
entry: ['@babel/polyfill','./src/index.js'],
output: {
path: path.resolve(__dirname, 'build'),
filename: 'index.js',
libraryTarget: 'commonjs2'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
include: path.resolve(__dirname, 'src'),
exclude: /(node_modules|bower_components|build)/,
use: ['babel-loader']
},
{
test: /\.css$/,
include: path.resolve(__dirname, 'src'),
exclude: /(node_modules|bower_components|build)/,
use:['style-loader','css-loader']
},
]
},
externals: {
'react': 'commonjs react'
},
resolve: {
extensions: ['*', '.js', '.jsx']
}
};
repo can be found here https://github.com/shorif2000/react-js-banner