I'm overwhelmed with numerous errors and not sure where to even begin.
Error Log
> webpack
[webpack-cli] The configuration object for webpack is invalid. It seems that the configuration object does not match the API schema.
- configuration.module.rules[1] should be one of the following:
["..." | object { assert?, compiler?, dependency?, descriptionData?, enforce?, exclude?, generator?, include?, issuer?, issuerLayer?, layer?, loader?, mimetype?, oneOf?, options?, parser?, realResource?, resolve?, resource?, resourceFragment?, resourceQuery?, rules?, scheme?, sideEffects?, test?, type?, use? }, ...]
-> A rule.
Details:
* configuration.module.rules[1].loader must be a non-empty string.
-> A loader request.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f68493979582a992849f9a9ab6c7d8c6d8c6">[email protected]</a> build: `webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! The build script for <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dba9bebab8af84bfa9b2b7b79beaf5ebf5eb">[email protected]</a> has failed.
npm ERR! This issue is most likely not related to npm. There might be additional logging information above.
npm ERR! You can find a detailed log of this run at:
npm ERR! /Users/yamaguchishuuhei/.npm/_logs/2021-08-28T17_30_34_922Z-debug.log
package.json
{
"name": "react_drill",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"build": "webpack"
},
"repository": {
"type": "git",
omitted
webpack.config.js
module.exports = {
entry: {
app: "./src/index.js"
},
output: {
path: __dirname + '/public/js',
filename: "[name].js"
},
devServer: {
contentBase: __dirname + '/public',
port: 8080,
publicPath: '/js/'
},
devtool: "eval-source-map",
mode: 'development',
module: {
rules: [{
test: /\.js$/,
enforce: "pre",
exclude: /node_modules/,
loader: "eslint-loader"
}, {
test: /\.css$/,
loader: ["style-loader","css-loader"]
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}]
}
};