Error:options.query cannot be used with loaders

原代码:

 test: /(\.jsx|\.js)$/,

 loaders:["babel-loader","eslint-loader"] ,

 options:{
     cacheDirectory:true
 },
 exclude: /node_modules/,

报错:error:options.query cannot be used with loaders
如下:
Error:options.query cannot be used with loaders_第1张图片

解决:

 test: /(\.jsx|\.js)$/,
 use:[
      {loader:"eslint-loader"},
      {
          loader:"babel-loader",
          options:{//options、query不能和loader数组一起使用
              cacheDirectory:true//利用缓存,提高性能,babel is slow
          },
      }
  ],
  exclude: /node_modules/,

你可能感兴趣的:(构建工具,webpack,options,cacheDirectory)