Skip to content

Feat/static generation - #629

Closed
jimhlad wants to merge 7 commits into
nuxt:mainfrom
jimhlad:feat/static-generation
Closed

Feat/static generation#629
jimhlad wants to merge 7 commits into
nuxt:mainfrom
jimhlad:feat/static-generation

Conversation

@jimhlad

@jimhlad jimhlad commented Oct 8, 2022

Copy link
Copy Markdown
Contributor

This is a modified version of @pi0 's PR for static image generation (took the heavy lifting from there).

Would be interested to get a second pair of eyes from @danielroe or someone on the Nuxt team.

P.S. Not sure if creating a separate PR was the best approach. Feel free to close this out if it's way off the mark or if modifying the original PR is easier. Thanks!

@netlify

netlify Bot commented Oct 8, 2022

Copy link
Copy Markdown

👷 Deploy request for nuxt-image-v1 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit bcd2b74

@jimhlad

jimhlad commented Nov 2, 2022

Copy link
Copy Markdown
Contributor Author

Updated to address issue outlined here: #614 (comment)

@jimhlad

jimhlad commented Nov 2, 2022

Copy link
Copy Markdown
Contributor Author

Updated to fix issue with srcset image generation

@husayt

husayt commented Nov 16, 2022

Copy link
Copy Markdown

This works great. Please merge asap

@brunodeangelis

Copy link
Copy Markdown

Given that #614 has seen some activity today by @pi0 , which one should be merged?

Comment thread src/runtime/ipx.ts
const ipxOptions = {
...(useRuntimeConfig().ipx || {}),
// TODO: Switch to storage API when ipx supports it
dir: fileURLToPath(new URL('../public', import.meta.url))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workaround works also for the production .output/ directory structure as path is resolved at runtime. If we do resolve() in src/ipx.ts, full path of build environment will be into the bundle.

@pi0

pi0 commented Nov 24, 2022

Copy link
Copy Markdown
Member

Thanks for your work on this @jimhlad please keep doing this ❤️ For now, I went with #614 solution.

@pi0 pi0 closed this Nov 24, 2022
@jimhlad

jimhlad commented Nov 24, 2022

Copy link
Copy Markdown
Contributor Author

Thanks @pi0 .

Does it work with multiple formatters at the same time though (e.g. width, height and quality)?

I recall I had to add trim() here to fix something (I forget what it was though):

...(sizes.value.srcset || '').split(',').map(s => s.trim().split(' ')[0])

Also had some issues using process in the <nuxt-img> component. But maybe fixed now 😄

@pi0

pi0 commented Nov 24, 2022

Copy link
Copy Markdown
Member

Feel free to open PR for other issues ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants