Skip to content

Instantly share code, notes, and snippets.

@foreverplay
Created August 1, 2018 10:02
Show Gist options
  • Save foreverplay/f18aa2476e6d189276fd446fc2a6cd1d to your computer and use it in GitHub Desktop.
Save foreverplay/f18aa2476e6d189276fd446fc2a6cd1d to your computer and use it in GitHub Desktop.
vue-cli 3 sass转换less
因为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