Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 设置环境时出现的问题已初始化网页_Reactjs_Webpack - Fatal编程技术网

Reactjs 设置环境时出现的问题已初始化网页

Reactjs 设置环境时出现的问题已初始化网页,reactjs,webpack,Reactjs,Webpack,我正在为react js设置环境,我面临以下错误 我正在跟踪 链接-- 如果需要更改,请让我更正 无效的配置对象。已使用与API架构不匹配的配置对象初始化Web包。 -configuration.module具有未知属性“loaders”。这些属性是有效的: 对象{exprContextCritical?、ExprContextExecutive?、ExprContextExecutive?、exprContextRequest?、noParse?、rules?、defaultRules?、un

我正在为react js设置环境,我面临以下错误

我正在跟踪 链接--

如果需要更改,请让我更正

无效的配置对象。已使用与API架构不匹配的配置对象初始化Web包。 -configuration.module具有未知属性“loaders”。这些属性是有效的: 对象{exprContextCritical?、ExprContextExecutive?、ExprContextExecutive?、exprContextRequest?、noParse?、rules?、defaultRules?、unknownContextCritical?、unknownContextRecursive?、unknownContextRegExp?、unknownContextRequest?、Unfectache?、wrappedContextRecursive?、wrappedContextRegExp?、strictExportPresence?、StrictThisContextContextOn进口?} ->影响普通模块的选项(
NormalModuleFactory
)。

不希望模块下有“加载程序”。根据文档,配置看起来不同。

尝试:


Link--当我使用npm start命令时,我得到了上面的错误..下面是webpack-config.js--var config={entry:'./main.js',输出:{path:'/',filename:'index.js',},devServer:{inline:true,port:8080},模块:{loaders:[{test:/\.jsx?$/,exclude:/node_modules/,loader:'babel loader',query:{presets:['es2015','react']}]}}}}module.exports=config;
var config = {
    entry: './main.js',
    output: {
        path:'/',
        filename: 'index.js',
    },
    devServer: {
        inline: true,
        port: 8080
    },
    module: {
        rules: [{
            test: /\.jsx?$/,
            exclude: /node_modules/,
            loader: 'babel-loader',
            use: {
                loader: 'babel-loader',
                options: {
                    presets: ['es2015', 'react']
                }
            }
        }]
    },
};

module.exports = config;