const path = require("path");

module.exports = {
    mode: "development", // or "production",
    entry: "./index.jsx",
    output: {
        path: path.resolve(__dirname, "public"),
        filename: "main.js"
    },
    target: "web",
    devServer: {
        static: {
            directory: path.join(__dirname, 'public'),
        },
        host: "127.0.0.1",
        port: "9000",
        open: true,
        hot: true,
        liveReload: true
    },
    resolve: {
        extensions: ['.js', '.jsx', '.json']
    },
    module: {
        rules: [
            {
                test: /\.(js|jsx)$/,
                exclude: /node_modules/,
                loader: 'babel-loader',
                options: {
                    presets: ["@babel/preset-react"]
                }
            }
        ]
    }
}