Comments (6)
@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.
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.
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.
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.
@ABuffSeagull fixed this rather crudely with this plugin: https://github.com/lukechilds/parcel-plugin-ogimage
from parcel-plugin-prerender.
I mean hey, whatever gets the job done 😄
from parcel-plugin-prerender.
Related Issues (16)
- Better console output HOT 1
- Minify HTML Output
- is the documentation about the configuration file wrong? HOT 1
- flag for crawling links, following the routes and prerendering them HOT 1
- flag for adding inline css to generated html files HOT 1
- Problem with parcels dynamic imports
- TypeError: Cannot read property 'map' of undefined HOT 2
- Auto-generate routes HOT 2
- Docs impovements HOT 1
- [Question] Is there any way to run some js only during prerendering? HOT 1
- Parcel 2 Support?
- Better testing
- Relative deployment path support
- Add testing
- No paths are rendered by default HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parcel-plugin-prerender.