项目已经搭建,需要添加stylus
- cmd, 进入项目所在目录, 输入vue add style-resources-loader (或 npm i vue-cli-plugin-style-resources-loader)
- vue.config.js中,修改.styl文件所在目录
// vue.config.js详情
const path = require('path');
module.exports = {
pluginOptions: {
'style-resources-loader': {
preProcessor: 'stylus',
patterns: [
// path.resolve(__dirname, 'src/styles/abstracts/*.styl'),
path.resolve(__dirname, 'src/assets/styles/index.styl'),
],
}
}
所有评论(0)