Coder Social home page Coder Social logo

Comments (6)

lukechilds avatar lukechilds commented on July 24, 2024

@ABuffSeagull what do you think the likelihood of getting this working is?

I'm not really sure it's possible without doing some crazy hacks.

One idea I had would be running a local server and serving the dist directory, then running a proxy server proxying --public-url to the local server. Then we could get the puppeteer Chromium instance to use the proxy.

That should work but it's pretty messy. Do you have any better ideas?

from parcel-plugin-prerender.

lukechilds avatar lukechilds commented on July 24, 2024

Actually that would then break if they're making any requests to --public-url that aren't static.

e.g https://example.com/api/foo will now get proxied to our local server and fail.

I'm starting to think there just isn't a solution to this.

If you want local prerendering you need to use relative URLs.

from parcel-plugin-prerender.

ABuffSeagull avatar ABuffSeagull commented on July 24, 2024

I will have to admit, it took me quite a while to really understand what you're talking about 😆. But yeah, I don't think there's a way you can have both a dynamic request at prerender time, and --public-url set.
The only way I think it could work is if you have your frontend and backend on different hostnames (e.g. https://example.com and https://api.example.com), but obviously that's a pretty specific use case.

from parcel-plugin-prerender.

lukechilds avatar lukechilds commented on July 24, 2024

Yeah I think it's probably best to close this issue.

Unfortunately absolute URLs are required for og:image tags. I don't think you can specify an absolute URL for only certain assets with parcel.

I could write a separate plugin that parses HTML for og:image tags and sets an absolute source but that's not a great solution.

from parcel-plugin-prerender.

lukechilds avatar lukechilds commented on July 24, 2024

@ABuffSeagull fixed this rather crudely with this plugin: https://github.com/lukechilds/parcel-plugin-ogimage

from parcel-plugin-prerender.

ABuffSeagull avatar ABuffSeagull commented on July 24, 2024

I mean hey, whatever gets the job done 😄

from parcel-plugin-prerender.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.