小编ron*_*ker的帖子

Webpack配置有一个未知属性'preLoaders'

我正在从头开始学习webpack.我已经学会了如何将javascript文件与require链接起来.我正在捆绑和缩小我的js文件,我正在监听手表的变化.我正在设置加载器将我的sass文件转换为css.但是当我尝试使用jshint-loader设置linting过程时,我遇到了问题.

    module: {
preLoaders: [
        {
            test: /\.js$/, // include .js files
            exclude: /node_modules/, // exclude any and all files in the node_modules folder
            loader: "jshint-loader"
        }
],

loaders: [
  {
    test: /\.scss$/,
    loader: 'style-loader!css-loader!sass-loader'
  },
  {
    test: /\.js$/,
    loader: 'babel-loader',
    exclude: /node_modules$/,
    query: {
      presets: ['es2015']
    }
  }
],
Run Code Online (Sandbox Code Playgroud)

}

这是错误

配置对象无效.Webpack已使用与API架构不匹配的配置对象进行初始化. - configuration.module有一个未知属性'preLoaders'.这些性质是有效的:对象{exprContextCritical ?, exprContextRecursive ?, exprContextRegExp ?, exprContextRequest ?,装载机?, noParse ?,规则?,?,unknownContextCritical ?, unknownContextRecursive ?, unknownContextRegExp ?, unknownContextRequest ?, unsafeCache ?, wrappedContextCritical ?, wrappedContextRecursive wrappedContextRegExp ?影响正常模块的选项(NormalModuleFactory).

lint config preloader webpack

29
推荐指数
2
解决办法
3万
查看次数

标签 统计

config ×1

lint ×1

preloader ×1

webpack ×1