const path = require("path"); module.exports = { target: "node", mode: "production", entry: "./src/index.js", output: { filename: "index.js", path: path.resolve(__dirname, "dist"), }, node: { __dirname: false, }, module: { rules: [ { test: /\.node$/, loader: "node-loader", }, ], }, };