npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gatsby-plugin-no-javascript-utils

v0.13.1

Published

The utils for static site without javascript

Downloads

11,225

Readme

gatsby-plugin-no-javascript-utils

npm version

The utils for static site without JavaScript

Support Gatsby v2, v3, v4 and v5

Install

npm i gatsby-plugin-no-javascript-utils
#or
yarn add gatsby-plugin-no-javascript-utils

How to use

// In your gatsby-config.js
module.exports = {
  siteMetadata: {
    title: 'Blog',
    description: 'Web Blog',
  },
  polyfill: false,
  plugins: [
    'gatsby-plugin-react-helmet',
    'gatsby-plugin-postcss',

    /* ... */

    // make sure it is included last in the plugins array.
    'gatsby-plugin-no-javascript-utils',
  ],
}

Options

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: 'gatsby-plugin-no-javascript-utils',
      options: {
        noScript: true,
        noSourcemaps: true,
        removeGeneratorTag: true,
        removeHeadDataAttrs: true,
        noInlineStyles: false,
        removeGatsbyAnnouncer: false,
      },
    },
  ],
}

noScript?: boolean (default: true)

Removes all scripts and preload links for scripts and page-data fetching.

<head>
  <meta charSet="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
- <link as="fetch" rel="preload" href="/page-data/index/page-data.json" crossorigin="anonymous">
- <link as="script" rel="preload" href="/commons-04bd7a1d51d6af5d636b.js">

  ⋯

- <script id="gatsby-chunk-mapping"> ⋯ </script>
- <script src="/polyfill-fa0c516ee6a6b8206a36.js" nomodule=""></script>
- <script src="/commons-04bd7a1d51d6af5d636b.js" async=""></script>
</body>

noSourcemaps?: boolean (default: true)

Disable generation of JavaScript sourcemaps.

removeGeneratorTag?: boolean (default: true)

Remove generator meta tag

<head>
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="generator" content="Gatsby 2.21.4">
  <title>My Blog</title>

removeHeadDataAttrs?: boolean (default: true)

Removes data-react-helmet and data-gatsby-head data attributes

- <html lang="en" data-react-helmet="lang">
- <meta name="description" content="my blog" data-gatsby-head="true">
+ <html lang="en">
+ <meta name="description" content="my blog">

noInlineStyles?: boolean (default: false)

Replacing <style data-href> tag with <link> tag for reducing the size of HTML files and browser caching of CSS files.

- <style data-href="/styles.457cfd10c24f55260d5a.css"> ⋯ </style>
+ <link rel="stylesheet" href="/styles.457cfd10c24f55260d5a.css">

removeGatsbyAnnouncer?: boolean (default: false)

The <div id="gatsby-announcer" ⋯> is announcing route changes in a single-page application where the pages update without a reload. It may be unnecessary on a static sites when you don't use any JavaScript.

More: Accessibility Improvements to Client Side Routing in Gatsby

<body>
  <div id="___gatsby">
    <div style="outline:none" tabindex="-1" id="gatsby-focus-wrapper"> ⋯ </div>
-   <div id="gatsby-announcer" style="position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0" aria-live="assertive" aria-atomic="true"></div>
  </div>

License

MIT