configure webpack 4 with react code example
Example 1: jsx babel webpack
module.exports = {
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
}
]
}
};
Example 2: reactjs and webpack tutorial
npm i webpack webpack-cli --save-dev
Example 3: reactjs and webpack tutorial
"scripts": {
"build": "webpack --mode production"
}