- 对于引入的文件,如果是[".png", ".jpg", ".jpeg"]类型'require("./a.png")' , 则转换为 'require(window.isSupportWebp ? "./a.webp" : "./a.png");'
- 可以添加注释跳过转换, 如'require("./a.png" /*webp-ignore*/)'
- window.isSupportWebp 需要自行添加
-
Notifications
You must be signed in to change notification settings - Fork 0
require图片转换为 supportWebp ? 'webp' : '原格式'
License
someBrown/babel-plugin-auto-webp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
require图片转换为 supportWebp ? 'webp' : '原格式'
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published