emiliobondioli / nuxt-magpie

Build module for Nuxt.js to download remote images and include them as local files in the generated build when performing full static generation
MIT License
12 stars 1 forks source link

Images optimizations and transformations #7

Open Triloworld opened 3 years ago

Triloworld commented 3 years ago

Hello, Work great and nice ui. Before connecting to API i use local images and library @aceforth/nuxt-optimized-images This give my variety of images based on context. Can optimization be done on images? Maybe run library after download images ?

For me solution is run library in context of running require(downloaded_file)and fallback to path. So any system can be connected to this library

emiliobondioli commented 3 years ago

I think this would be nice feature, but haven't yet found some time to explore the best way to integrate it with Magpie. I agree that it should be left as an optional last step after images are downloaded.

If I'm not wrong, some of the optimizations only work by serving the correct image during runtime and, since Magpie only works during static generation, it might become tricky to process the images with nuxt-optimized-images pipeline - but this needs further investigation.

Triloworld commented 3 years ago

4 approach is possible to this module will fix that problem:

Example:

require(`${this.$magpie.local('https://api.localhost/xyz.jpg')}`)