react之运行webpack报错:configuration.module has an unknown property 'loaders'

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.module has an unknown property 'loaders'. These properties are valid:
   object { defaultRules?, exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, strictExportPresence?, strictThisContextOnImports?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? }
   -> Options affecting the normal modules (`NormalModuleFactory`).

react之运行webpack报错:configuration.module has an unknown property 'loaders'_第1张图片

这是因为webpack在3.0以后把loaders改为rules:

更改后的webpack.config.js文件:

react之运行webpack报错:configuration.module has an unknown property 'loaders'_第2张图片

 

你可能感兴趣的:(react)