sass-loader 版本问题导致编译报错记录
文章目录
使用vue-cli 创建 uni-app项目,需要使用sass,安装上相关依赖包后,运行报错:
Style Loader has been initialized using an options object that does not match the API schema.
options has an unknown property 'prependData'.
使用 vue inspect 命令查看到css loader options中有prependData的配置项,去sass-loader github上查阅更新记录发现9.0.0的版本升级中去掉了prependData,升级成了additionalData选项。
引用原文:
9.0.0 (2020-07-02)
⚠ BREAKING CHANGES
- minimum supported Nodejs version is
10.13- prefer
sass(dart-sass) by default, it is strongly recommended to migrate onsass(dart-sass)- the
prependDataoption was removed in favor theadditionalDataoption, see docs- when the
sourceMapistrue,sassOptions.sourceMap,sassOptions.sourceMapContents,sassOptions.sourceMapEmbed,sassOptions.sourceMapRootandsassOptions.omitSourceMapUrlwill be ignored.
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论