const path = require("path"); const CopyPlugin = require("copy-webpack-plugin"); module.exports = { entry: { main: path.join(__dirname, "src", "main.ts"), }, output: { path: path.join(__dirname, "dist"), filename: "[name].js", }, devtool: "source-map", resolve: { extensions: [".ts", ".js"], }, module: { rules: [ { test: /\.[jt]s$/, exclude: /(node_modules)/, use: [ { loader: "babel-loader", options: { presets: ["@babel/preset-env"], }, }, { loader: "ts-loader", }, ], }, ], }, plugins: [ new CopyPlugin({ patterns: [{ from: ".", to: ".", context: "public" }], }), ], };