React使用stylus,并解决typeerror this.getoptions is not a function问题
先下载stylus相关包
npm install stylus stylus-loader --save-dev
然后显示隐藏的相关配置文件
npm run eject
如果有你使用了git还会报错,所以需要在项目目录执行一下
git add .
git commit -m "初始化项目(备注)"
然后在config/webpack.config.js里添加以下内容(前面css/cass都是自带的,脚手架搭起来的都有)
const stylusRegex = /\.styl|stylus$/;
原创
2021-07-06 15:39:45 ·
376 阅读 ·
0 评论