module.exports = {
  entry: "./src/index.js",
  output: {
    filename: "bundle.js"
  }
};

const path = require("path");

module.exports = {
  entry: "./src/index.js",
  output: {
    filename: "bundle.js",
    path: path.resolve(__dirname, "build")
  }
};

Edit webpack.config.js