Created
August 1, 2018 10:02
-
-
Save foreverplay/f18aa2476e6d189276fd446fc2a6cd1d to your computer and use it in GitHub Desktop.
vue-cli 3 sass转换less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
因为sass在windows上容易安装失败,而且还容易被墙 | |
所以将sass转换成less | |
具体步骤 | |
yarn remove node-sass && sass-loader | |
yarn add less && less-loader | |
vue.config.js内部配置 | |
module.exports = { | |
css: { | |
loaderOptions: { | |
css: { | |
// options here will be passed to css-loader | |
less: { | |
loader: 'less-loader', | |
}, | |
}, | |
postcss: { | |
// options here will be passed to postcss-loader | |
}, | |
}, | |
}, | |
}; | |
最后一点 | |
<style lang="scss" scoped> | |
改成 | |
<style lang="less" scoped> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment