gatsby-plugin-no-javascript-utils is a Gatsby plugin designed to assist in generating purely static sites with minimal to no client-side JavaScript. It currently ships as version 0.13.2, which supports Gatsby versions 2 through 5, indicating a stable but relatively slow release cadence, typical for plugins that modify core build outputs rather than introduce new features. Its primary differentiator is its focus on stripping out various JavaScript-related artifacts that Gatsby typically includes by default, such as script tags, preload links for scripts and page data, JavaScript sourcemaps, and client-side routing announcers. Additionally, it offers options to remove generator meta tags, data attributes from head elements (like `data-react-helmet`), and convert inline `<style data-href>` tags to external `<link>` tags for improved caching and smaller HTML files. This makes it ideal for highly SEO-sensitive sites or those targeting extremely lightweight builds where JavaScript is entirely optional or handled externally.
npm install gatsby-plugin-no-javascript-utilsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to add the plugin to `gatsby-config.js` and configure its main options to achieve a truly JavaScript-free Gatsby build, optimizing for minimal HTML output and enhanced caching.
Ensure your site is intended to be purely static with no client-side interactions if `noScript` is enabled. Test thoroughly to confirm no essential functionality relies on JavaScript.
Always place `'gatsby-plugin-no-javascript-utils'` as the final entry in your `plugins` array in `gatsby-config.js`.
Verify that your build pipeline correctly generates and serves external CSS files when `noInlineStyles` is active. Test your site's styling thoroughly across browsers.
If `noScript` is enabled, it's recommended to set `removeGatsbyAnnouncer: true` to further reduce HTML bloat and ensure consistency with a pure static site approach.
If you need client-side interactivity, set `noScript: false` in the plugin options, or remove `gatsby-plugin-no-javascript-utils` entirely if JavaScript is fundamental to your site's functionality.
Inspect your `public` directory to ensure CSS files are being generated. Check the browser's network tab to see if CSS `<link>` tags are loading the correct files. Adjust your Gatsby styling setup if necessary to ensure compatibility with external CSS linking.
Move `gatsby-plugin-no-javascript-utils` to the very end of your `plugins` array in `gatsby-config.js`.