configuration.module具有未知的属性'use'

我正在尝试构建一个不使用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.

vieto5006 回答:configuration.module具有未知的属性'use'

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3121758.html

大家都在问