I installed webpack in my project folder and hoping to run a simple interface to test around my front end by typing "npm run start" using cmd in the project folder. but I have received this error
I reinstall it and run "npm install" and did "npm audit fix" but receive warnings saying that require peer of webpack@^4.0
it feel like it says that I did not install webpack. but I believe I have.
Here is the package.json
{
"name": "app",
"version": "1.0.0",
"description": "",
"private": true,
"scripts": {
"build": "webpack",
"start": "webpack-dev-server"
},
"devDependencies": {
"copy-webpack-plugin": "^6.3.2",
"webpack": "^5.9.0",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"web3": "^1.2.4"
}
}
Here is my webpack.config.js
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = {
entry: "./src/index.js",
output: {
filename: "index.js",
path: path.resolve(__dirname, "dist"),
},
plugins: [
new CopyWebpackPlugin([{ from: "./src/index.html", to: "index.html" }]),
],
devServer: { contentBase: path.join(__dirname, "dist"), compress: true },
};
let me know what I did wrong here. Thank you