Skip to content

liugenpeng/grunt-webpcss-enhance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-webpcss-enhance

适配webp格式图片处理样式表的grunt插件

Getting Started

This plugin requires Grunt ~0.4.5

用法

1.安装

  npm install grunt-webpcss --save-dev

2.gruntfile 基本用法

   grunt.loadNpmTasks('grunt-webpcss');
    ...
      webpcss: {

          mytask: {
              options: {
                  webpClass:'.webp',
                  noWebpClass:"",
                  imgRules:{
                      replace_from:/\.(png|jpg|jpeg)/,
                      replace_to:".webp"
                  },
                  urlRules:{
                      replace_from:'../images',
                      replace_to:'../images/webp'
                  },
                  cssStyles:{
                      compatibility:true,
                      keepBreaks:true,
                      advanced:false
                  }
              },
              files: {
                 './app2.css': ['./test/app.css']
              }
          }
        }
    ...

About

为适配webp格式图片的grunt插件

Resources

License

Stars

Watchers

Forks

Packages

No packages published