简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM