Build HTML5 projects to none-WebP and WebP versions(i.e. js files and css files), then dynamically load scripts of different versions according to the browser's WebP capabilities.
This is a demo project. If you want to use this technique, you can take advantage of my ideas, and source code, if needed.
-
Install Depenencies:
npm i
-
Build Project:
npm run build
-
Open
dist/index.html
(You might need start a HTTP server) in different browsers to see demo. Or open https://swenyang.github.io/webp-multi-versioning to see online demo.
Why use multi-versiong technique for WebP images? Illustrated in my article here.