Vue.config.js配置报错怎么解决?

WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

  • configuration.module.rules[12].include should be one of these:
    RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? } | [RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? }]
    -> One or multiple rule conditions
    Details:
    • configuration.module.rules[12].include should be an instance of RegExp
    • configuration.module.rules[12].include should be a string.
    • configuration.module.rules[12].include should be an instance of function
    • configuration.module.rules[12].include[0] should be an instance of RegExp
    • configuration.module.rules[12].include[0]: The provided value “packages” is not an absolute path!
    • configuration.module.rules[12].include[0] should be an instance of function
    • configuration.module.rules[12].include[0] should be an array:
      [RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? }]
    • configuration.module.rules[12].include[0] should be an object.
    • configuration.module.rules[12].include should be an object.
    • configuration.module.rules[12].include[0] should be an instance of RegExp
    • configuration.module.rules[12].include[0]: The provided value “packages” is not an absolute path!
    • configuration.module.rules[12].include[0] should be an instance of function
    • configuration.module.rules[12].include[0] should be an array:
      [RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? }]
    • configuration.module.rules[12].include[0] should be an object.

你的配置写错了(Webpack 部分)。发出来看看。