我正在尝试构建一个不使用creat-react-app的React应用程序。
这是我的package.config.js:
//configurations for babel loader
const HtmlWebPackPlugin = require("html-webpack-plugin");
const htmlPlugin = new HtmlWebPackPlugin({
template: "./src/index.html",
filename: "./index.html"
});
module.exports = {
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
}
],
use: [
{
loader: "style-loader"
},
{
loader: "css-loader",
options: {
modules: true,
importLoaders: 1,
localIdentName: "[name]_[local]_[hash:base64]",
sourceMap: true,
minimize: true
}
}
]
},
plugins: [htmlPlugin]
};
我运行npm start
后,控制台上显示的错误消息是:
✖ 「wds」: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.