import path from "path"; import Dotenv from "dotenv-webpack"; import { fileURLToPath } from "url"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); export default { mode: "development", entry: "./src/index.ts", output: { filename: "main.js", path: path.resolve(__dirname, "dist"), libraryTarget: "commonjs2", }, target: "node", resolve: { extensions: [".ts", ".js"], }, module: { rules: [ { test: /\.ts$/, use: "ts-loader", exclude: /node_modules/, }, ], }, devtool: "source-map", plugins: [new Dotenv()], };