Open mad-gav opened 4 years ago
You can set omitPrismicScript
to true
in the source config to stop it eager-loading the prismic script. I haven't seen any negative repercussions in doing that in my own projects, not sure why it's not the default
@seaneking does it brake the previews?
It didn’t when I was using it, though I’ve since moved to gatsby-source-prismic which uses its own preview layer
It will break previews, yes. Hence, undocumented.
Here is a classic setup: a) production site with omitPrismicScript set to true and previews disabled b) setup a staging site with everything working well.
But adding a defer would be fine, what does Prismic say, is it required? @arnaudlewis
Here is a classic setup: a) production site with omitPrismicScript set to true and previews disabled b) setup a staging site with everything working well.
I would love to see that in the docs @birkir .
Hi yes, also having same issue with my performance reports. Any update on the defer? Thanks!
Adding defer would be much appreciated!
@DanielJohnsson87, @kylorobs this PR addresses your issue. I have not tested however if it breaks something.
What you could do in the meantime I guess is the following:
set:
omitPrismicScript: true,
and include the prismic script yourself with
https://www.gatsbyjs.org/packages/gatsby-plugin-react-helmet/
I'm getting lighthouse warnings for the prismic file thats included. Is there any chance of adding a defer to the script so it's not render blocking?
Presumably this is only needed for the preview part?