matthiasott,
@matthiasott@mastodon.social avatar

If you want to get started with @eleventy using @vite you can have a look at this starter project I created a while ago. I just updated it to Eleventy 2.0.1 and Vite 4. Any feedback or contributions are very welcome! 🤗
https://github.com/matthiasott/eleventy-plus-vite

mikemai2awesome,
@mikemai2awesome@mastodon.social avatar

@matthiasott nice. I need to play with this

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@matthiasott @eleventy @vite Have you thought about tackling image optimization yet with Vite and 11ty? It’s still a sore sport for my use of 11ty and Vite together and was curious if you’d thought about it.

matthiasott,
@matthiasott@mastodon.social avatar

@khalidabuhakmeh Not yet, but I’ll add that to my list! 🙌

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@matthiasott It’s a tough problem. I really like how 11ty’s Image plugin works, and there are roll-up plugins as well (but they were made for a SPA model, not a static model).

The issue with 11ty’s image plugin is it processes images asynchronously but there is no async/await happening, so your HTML templating processing can finish before the images have had a chance to process completely.

That’s when Vite starts to look for images, but then doesn’t find them, thus blowing up.

zachleat, (edited )
@zachleat@zachleat.com avatar

@khalidabuhakmeh @matthiasott hmm I think passthrough copy operates like this, but not the image plugin.

const Image = require("@11ty/eleventy-img");  
await Image(url);  
// the files are done writing to the file system  

You’re probably thinking of the workaround for synchronous usage: https://www.11ty.dev/docs/plugins/image/#synchronous-shortcode (which was originally added for Vue 2)

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@zachleat @matthiasott Oh wait… I forgot a part. We are using vhtml and JSX syntax. So it’s less an 11ty/Vite issue and a JSX with 11ty issue (mostly on the JSX part).

zachleat,
@zachleat@zachleat.com avatar

@khalidabuhakmeh @matthiasott narrows eyes at JSX

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@zachleat @matthiasott
@pauleveritt made me do it! 🫣

matthiasott,
@matthiasott@mastodon.social avatar

@eleventy @vite My plan is to soon update it to Vite 5, which has just been released: https://vitejs.dev/blog/announcing-vite5
But I first need to check whether there are any breaking changes that could cause problems…

  • All
  • Subscribed
  • Moderated
  • Favorites
  • 11ty
  • tacticalgear
  • DreamBathrooms
  • cisconetworking
  • khanakhh
  • mdbf
  • magazineikmin
  • modclub
  • InstantRegret
  • rosin
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • ngwrru68w68
  • JUstTest
  • everett
  • tester
  • cubers
  • normalnudes
  • thenastyranch
  • osvaldo12
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • megavids
  • lostlight
  • All magazines