1、安装依赖
处理普通的.css 文件, 需要安装css-loader,style-loader
.less 文件, 需要安装 less-loader
npminstall css-loader style-loader --save-dev
npminstall less-loader --save-dev
2、安装好相关loader后,我们需要在webpack.base.conf.js或者webpack.config.js 中加入相关配置代码,如下
{
test: /.(woff2?|eot|ttf|otf)(?.*)?KaTeX parse error: Expected 'EOF', got '}' at position 156: … }
}̲,
{
…/,
use:[
“style-loader”,“css-loader”,“less-loader”
]
}
3、在style中加入lang="less"即可使用less
左尖括号style scoped lang=“less”>
@nice-yellow:#5b854a;
.page{
width: 50px;
height:30px;
background: @nice-blue;
}
左尖括号/style>