You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a Nuxt 3 project. The app is rendered statically.
I use the Nuxt-Image plugin to optimize images.
The images are loaded from an external source called freeda.
Stack:
"nuxt": "^3.9.1",
"@nuxt/image": "^1.6.0",
According to the documentation, the images used should be downloaded during the build process (nuxt generate) - and generated in the build folder in the /_ipx folder. However, that doesn't happen.
The original paths to the provider are still stored in the compiled HTML files.
None of the externally used images are processed during the build process.
Also no errors are thrown. It seems like this is being ignored.
My nuxt.config:
exportdefaultdefineNuxtConfig({devtools: {enabled: true},modules: ["@pinia/nuxt",'@vee-validate/nuxt','@nuxt/image','nuxt-lazy-load','@nuxtjs/eslint-module','@nuxtjs/i18n','./modules/extendRoutes.ts'],i18n: {vueI18n: './i18n.config.ts'// if you are using custom path, default},css: ['~/assets/styles/bulma.scss','~/assets/styles/universal.scss','~/node_modules/@mdi/font/css/materialdesignicons.min.css'],image: {providers: {freeda: {provider: '~/providers/freeda.ts',// Path to custom provider}}},[ ... ]
My provider freeda.ts
import{joinURL}from'ufo'importtype{ProviderGetImage}from'@nuxt/image'import{createOperationsGenerator}from'#image'constoperationsGenerator=createOperationsGenerator()exportconstgetImage: ProviderGetImage=(src,{ modifiers ={}, baseURL }={})=>{if(!baseURL){// also support runtime configbaseURL=useRuntimeConfig().public.MEDIA_BASE}constoperations=operationsGenerator(modifiers)return{url: joinURL(baseURL,src+(operations ? '?'+operations : '')),}}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
I'm working on a Nuxt 3 project. The app is rendered statically.
I use the Nuxt-Image plugin to optimize images.
The images are loaded from an external source called freeda.
Stack:
According to the documentation, the images used should be downloaded during the build process (
nuxt generate
) - and generated in the build folder in the /_ipx folder. However, that doesn't happen.The original paths to the provider are still stored in the compiled HTML files.
None of the externally used images are processed during the build process.
Also no errors are thrown. It seems like this is being ignored.
My nuxt.config:
My provider freeda.ts
Use in the template:
Does anyone know of an approach to solving the problem?
I look forward to feedback
Best regards
Beta Was this translation helpful? Give feedback.
All reactions