import * as url from 'url'; const __filename = url.fileURLToPath(import.meta.url); const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); // const HtmlWebpackPlugin = require("html-webpack-plugin"); import HtmlWebpackPlugin from 'html-webpack-plugin'; const config = { entry: "./src/index.jsx", mode: "development", output: { path: `${__dirname}/build`, filename: "bundle.js", }, plugins: [ new HtmlWebpackPlugin({ template: "index.html", }), ], module: { rules: [ { test: /\.(js|jsx)$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { plugins: [ [ '@babel/plugin-transform-react-jsx', { "pragma": "justact.createElement" } ] ] } } } ] } }; export default config;