这段代码报错的原因是因为在使用 PostCSS Loader 时,传入的 options 对象中包含了一个未知的属性 'plugins'。PostCSS Loader 的 API schema 中只允许以下属性:

  • postcssOptions:一个包含 postcss 选项的对象。
  • execute:一个布尔值,表示是否应该在运行时执行 postcss。
  • sourceMap:一个布尔值或字符串,表示是否应该生成 Source Map。
  • implementation:一个自定义的 postcss 实现。

因此,需要将 options 对象中的 'plugins' 属性移除,或者将其作为 postcssOptions 对象的一个属性传递。

ValidationError Invalid options object PostCSS Loader has been initialized using an options object that does not match the API schema - options has an unknown property plugins These properties are val

原文地址: https://www.cveoy.top/t/topic/Kqr 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录