How to Solve Error:options.query cannot be used with loaders

Original code:

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

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

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

Error: error:options.query cannot be used with loaders
as follows:

Write picture description here

solve:

 test: /(\.jsx|\.js)$/,
 use:[
      {loader:"eslint-loader"},
      {
          loader:"babel-loader",
          options:{//options、queryCannot be used with loader arrays
              cacheDirectory:true//Use cache to improve performance and babel is slow
          },
      }
  ],
  exclude: /node_modules/,

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *