Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added basePath into image path generation #137

Merged
merged 2 commits into from
Jun 20, 2023

Conversation

wpoynter
Copy link
Contributor

Hi @Niels-IO

Great work on supporting external images. I have begun putting it to work for my statically built blog. As a final hurdle, we use a basePath as the blog sits within a larger site. I have begun the working of supporting basePath as set in next.config.js. I am pretty sure I have got a few issues:

  • There are no tests for the basePath scenario
  • Is next/router available in the new app directory setup supported by Next.JS 13?
  • Does this work add basePath where it shouldn't? E.g. to images specified by an internal path (/blog/images/banner.png)

Feel free to point out other things I have missed, or if my approach is going the wrong way for the package.

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
wpoynter Will Poynter

Verified

This commit was signed with the committer’s verified signature.
wpoynter Will Poynter
@itrich
Copy link
Contributor

itrich commented Jun 7, 2023

We're currently using next-image-export-organizer to optimize images for a static website built with Next.js. Thank you for publishing this helpful plugin. 😊

However, our static site is also deployed to a staging area that is available under a different basePath.

We'd really appreciate if this PR could be merged soon. Is there anything I can help you with, e.g. testing or reviewing?

@Niels-IO
Copy link
Owner

Niels-IO commented Jun 9, 2023

Hi @itrich, I continued the work from @wpoynter in #155. Do you have an idea how I would be able to locally serve the files with the subPath using the https://github.com/vercel/serve package? Some kind of rewrites would have to happen, probably.

@Niels-IO Niels-IO merged commit 1365707 into Niels-IO:master Jun 20, 2023
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.

None yet

3 participants