我在用Vue-cli 脚手架开发中,想使用compass作为css预编译器,
于是我做了如下操作:npm install compass --save-dev
先安装compass的预编译器
然后在.vue文件中设置了 <style>设置了 lang属性 <style lang="compass">
但是在编译器中报了错误
Currently the sass-loader does not follow all of the webpack loader guidelines. The general problem is that the entry scss-file is passed to node-sass which does pretty much the rest. Thus @import statements inside your scss-files cannot be resolved by webpack's resolver. However, there is an issue for that missing feature in libsass.
找了Vue的官方文档, 和Vue-lic的 readme 还有issue 都没有找到怎么切换css预编译语言的配置方案 ,故在此寻求我步骤中的错误,以及解决方案
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这个问题的答案,都是零零碎碎的,没有一个玩玩整整的解决方案。
所以最后我选择放弃了我使用已久的scss,现在使用的css预编译器是stylus ,在 Vue-cli 和gulp中间都在使用。
不过语法上可能有些让人不太适应,就像 ejs模板和jade模板一样的!不过胜在安装方便
工具旨在提高生产效率,所以我选择了,安装配置简单的stylus。
如果使用scss的话,我后面了解的不完全资料,可能需要依赖 sass-lib node-sass 还需要 python、c++编译环境。不展开说了,这点留给专业的人士来说吧