I have project with this structure:
my-app/
├─ node_modules/
├─ dist/
├─ src/
│ ├─ index.css
│ ├─ index.js
│ ├─ index.html
├─ package.json
├─ webpack.config.js
My webpack.js is:
const { Module } = require("webpack");
Module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: __dirname + '/dist',
}
}
When I run the command npx webpack
or npm run build
, the output file is always saved as dist/main.js
instead of dist/bundle.js
Any ideas of what I'am doing wrong?