fis-preprocessor-srcset

0.0.8 • Public • Published

fis-preprocessor-srcset

fis-preprocessor-srcset插件(npm地址 github地址)支持解析<img><picture>标签的srcset属性中的图片路径

 
    <picture>
    <source srcset="./image/banner-small.png 1x, ./image/banner-large.png 2x"/>
    <img src="./image/banner-small.png"/>
    </picture>
   

使用


    //install
    npm install -g fis-preprocessor-srcset


    //config
    vi <project>/fis-conf.js

    //fis3之前
    fis.merge.config({
        modules: {
            preprocessor: {
                tpl: "srcset" //如果您使用的是fis-plus或其它的解决方案,则需要加上相应的模板前处理插件,例如fis-plus中需要调整为"components,extlang,srcset"
            }
        },
        ....
    });
    
    //fis3
    fis.match('*.tpl', {
        preprocessor: fis.plugin('srcset')
    });
    

Package Sidebar

Install

npm i fis-preprocessor-srcset

Weekly Downloads

9

Version

0.0.8

License

MIT

Last publish

Collaborators

  • tjuking