wepy中如何使用stylus等样式预处理器

wepy中如何使用stylus等样式预处理器

一、如何在wepy中使用stylus

1、安装wepy-compiler-stylus(以及stylus, stylus-loader)

npm install wepy-compiler-stylus --save-dev 

2、配置根目录下的wepy.config.js

module.export = {  
  // ...其他配置  
  compilers: {  
    // ...其他配置  
    // 添加以下内容  
    stylus: {  
      compress: true  
    }  
  }  
} 

3、修改.wpy文件中的style标签中的lang属性

<style lang="stylus">  
  .user-info  
    background red  
<style>  

  

posted @ 2018-04-02 11:45  _林冲  阅读(354)  评论(0编辑  收藏  举报