Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to use Gatsby just for static html files without webpacked javascript files?

I want to generate a large number of static html. I like to use Gatsby because I enjoy writing JSX/TSX and generating the files using JavaScript.

But then every page includes the dehydrated GraphQL queries as well as an entire react for production runtime.

I know that that's what Gatsby does, but it is so flexible I imagine there must be a way to just generate the static html without the magic parts.

like image 963
L Richard Durr Avatar asked Oct 27 '25 03:10

L Richard Durr


1 Answers

There's no official support for this by Gatsby.

Looking through their issues on github, there's one where this is discussed though (they have some fair reasons for not having support for it). At the end of the issue there's a comment linking to a gatsby plugin doing just what you want it seems. You might want to give it a try.

Github issue: https://github.com/gatsbyjs/gatsby/issues/11680

Gatsby plugin: https://www.npmjs.com/package/gatsby-plugin-no-javascript

like image 187
tomahaug Avatar answered Oct 28 '25 15:10

tomahaug



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!