webpack.config.js
const path = require('path');
module.exports = {
entry: './public/home/scripts/_mongo.js',
mode: 'development',
output: {
filename: 'mongo.js',
path: path.resolve(__dirname, '..', 'public', 'home', 'scripts'),
},
};