Skip to content

tjuking/fis-preprocessor-srcset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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')
    });
    

About

fis-preprocessor-srcset插件支持解析img或picture标签的srcset属性中的图片路径

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published