报错信息:

ValidationError: Invalid options object. Sass Loader has been initialised using an options object that does not match the API schema.

  • options has an unknown property ‘data’. These properties are valid

解决方案:
将vue.config.js的css配置项的 data 改成prependData

css: {
    loaderOptions: {
      sass: {
        // 错误写法
        //data: `@import "./src/styles/main.scss";`
        // 正确写法
        prependData: `@import "./src/styles/main.scss";`
      }
  }
Logo

前往低代码交流专区

更多推荐