使用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
prependData
option was removed in favor theadditionalData
option, see docs- when the
sourceMap
istrue
,sassOptions.sourceMap
,sassOptions.sourceMapContents
,sassOptions.sourceMapEmbed
,sassOptions.sourceMapRoot
andsassOptions.omitSourceMapUrl
will be ignored.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。