const path = require('path'); // We can use whatever nodejs package

const config = {
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, 'build'), //./build
    filename: 'bundle.js'
  }
};

module.exports = config;

const config = {
  entry: './src/index.js'
};

module.exports = config;

--- 
+++ 
@@ -1,5 +1,11 @@
+const path = require('path'); // We can use whatever nodejs package
+
 const config = {
-  entry: './src/index.js'
+  entry: './src/index.js',
+  output: {
+    path: path.resolve(__dirname, 'build'), //./build
+    filename: 'bundle.js'
+  }
 };
 
 module.exports = config;
Set name and path of the output file
