Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

gatsby-plugin-utils

gatsbyjs1mMIT4.14.0TypeScript support: included

Gatsby utils that help creating plugins

gatsby

readme

Gatsby

Gatsby

The future of web development is here.

Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps.
It combines the control and scalability of dynamically rendered sites with the speed of static-site generation, creating a whole new web of possibilities.

Gatsby is released under the MIT license. Current CircleCI build status. Current npm package version. Downloads per month on npm. Total downloads on npm. PRs welcome! Follow @GatsbyJS

Quickstart · Tutorial · Plugins · Starters · Showcase · Contribute
Support: Twitter, Discussions & Discord

Gatsby helps professional developers efficiently create maintainable, highly-performant, content-rich websites.

  • Load Data From Anywhere. Gatsby pulls in data from any data source, whether it’s Markdown files, a headless CMS like Contentful or WordPress, or a REST or GraphQL API. Use source plugins to load your data, then develop using Gatsby’s uniform GraphQL interface.

  • Go Beyond Static Websites. Get all the benefits of static websites with none of the limitations. Gatsby sites are fully functional React apps, so you can create high-quality, dynamic web apps, from blogs to e-commerce sites to user dashboards.

  • Choose your Rendering Options. You can choose alternative rendering options, namely Deferred Static Generation (DSG) and Server-Side Rendering (SSR), in addition to Static Site Generation (SSG) — on a per-page basis. This type of granular control allows you to optimize for performance and productivity without sacrificing one for the other.

  • Performance Is Baked In. Ace your performance audits by default. Gatsby automates code splitting, image optimization, inlining critical styles, lazy-loading, prefetching resources, and more to ensure your site is fast — no manual tuning required.

  • Use a Modern Stack for Every Site. No matter where the data comes from, Gatsby sites are built using React and GraphQL. Build a uniform workflow for you and your team, regardless of whether the data is coming from the same backend.

  • Host at Scale for Pennies. Gatsby sites don’t require servers, so you can host your entire site on a CDN for a fraction of the cost of a server-rendered site. Many Gatsby sites can be hosted entirely free on Gatsby Cloud and other similar services.

  • Use Gatsby's Centralized Data Layer Everywhere. With Gatsby's Valhalla Content Hub you can bring Gatsby's data layer to any project. Making it accessible via a unified GraphQL API for building content sites, eCommerce platforms, and both native and web applications.

Learn how to use Gatsby for your next project.

🚀 Ship your first Gatsby site in 5 Minutes

Click the link below to quickly try the workflow of developing, building, and deploying websites with Gatsby and Gatsby Cloud.

Deploy to Gatsby Cloud

At the end of this process, you'll have

  1. a site working on Gatsby Cloud
  2. a new repository that is linked to that new site
  3. as you push changes to your new repository, Gatsby Cloud will automatically rebuild and redeploy your site!

💻 Get started with Gatsby locally in 5 Minutes

You can get a new Gatsby site up and running on your local dev environment in 5 minutes with these four steps:

  1. Initialize a new project.

    npm init gatsby

    Give it the name "My Gatsby Site".

  2. Start the site in develop mode.

    Next, move into your new site’s directory and start it up:

    cd my-gatsby-site/
    npm run develop
  3. Open the source code and start editing!

    Your site is now running at http://localhost:8000. Open the my-gatsby-site directory in your code editor of choice and edit src/pages/index.js. Save your changes, and the browser will update in real time!

At this point, you’ve got a fully functional Gatsby website. For additional information on how you can customize your Gatsby site, see our plugins and the official tutorial.

🎓 Learning Gatsby

Full documentation for Gatsby lives on the website.

  • For most developers, we recommend starting with our in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.

  • To dive straight into code samples head to our documentation. In particular, check out the “How-to Guides”, “Reference”, and “Conceptual Guides” sections in the sidebar.

We welcome suggestions for improving our docs. See the “how to contribute” documentation for more details.

Start Learning Gatsby: Follow the Tutorial · Read the Docs

🚢 Release Notes

Wondering what we've shipped recently? Check out our release notes for key highlights, performance improvements, new features, and notable bugfixes.

Also, read our documentation on version support to understand our plans for each version of Gatsby.

💼 Migration Guides

Already have a Gatsby site? These handy guides will help you add the improvements of Gatsby v5 to your site without starting from scratch!

❗ Code of Conduct

Gatsby is dedicated to building a welcoming, diverse, safe community. We expect everyone participating in the Gatsby community to abide by our Code of Conduct. Please read it. Please follow it. In the Gatsby community, we work hard to build each other up and create amazing things together. 💪💜

🤝 How to Contribute

Whether you're helping us fix bugs, improve the docs, or spread the word, we'd love to have you as part of the Gatsby community!

Check out our Contributing Guide for ideas on contributing and setup steps for getting our repositories up and running on your local machine.

A note on how this repository is organized

This repository is a monorepo managed using Lerna. This means there are multiple packages managed in this codebase, even though we publish them to NPM as separate packages.

📝 License

Licensed under the MIT License.

💜 Thanks

Thanks go out to all our many contributors creating plugins, starters, videos, and blog posts. And a special appreciation for our community members helping with issues and PRs, or answering questions on Discord and GitHub Discussions.

A big part of what makes Gatsby great is each and every one of you in the community. Your contributions enrich the Gatsby experience and make it better every day.

changelog

Changelog: gatsby-plugin-utils

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

4.13.1 (2024-01-23)

Note: Version bump only for package gatsby-plugin-utils

4.13.0 (2023-12-18)

🧾 Release notes

Features

Bug Fixes

  • support multiple instances of same variable in gatsbyImage placeholderUrl #38626 (b177db9)

4.12.3 (2023-10-26)

Note: Version bump only for package gatsby-plugin-utils

4.12.2 (2023-10-20)

Bug Fixes

  • support multiple instances of same variable in gatsbyImage placeholderUrl #38626 #38647 (02e925a)

4.12.1 (2023-10-09)

Note: Version bump only for package gatsby-plugin-utils

4.12.0 (2023-08-24)

🧾 Release notes

Bug Fixes

Chores

  • update dependency msw to ^1.2.2 for gatsby-plugin-utils #38285 (13fc00f)

4.11.0 (2023-06-15)

🧾 Release notes

Bug Fixes

Chores

  • update dependency rimraf to ^5.0.1 for gatsby-plugin-utils #38144 (10b2ef7)

4.10.0 (2023-05-16)

🧾 Release notes

Bug Fixes

  • update dependency joi to ^17.9.2 for gatsby-plugin-utils #38002 (db45fa0)

Chores

  • update dependency rimraf to v5 for gatsby-plugin-utils #38040 (94099a9)

4.9.0 (2023-04-18)

🧾 Release notes

Features

Bug Fixes

Chores

4.8.0 (2023-03-21)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

4.7.0 (2023-02-21)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

4.6.0 (2023-02-07)

🧾 Release notes

Bug Fixes

Chores

4.5.0 (2023-01-24)

🧾 Release notes

Chores

4.4.0 (2023-01-10)

🧾 Release notes

Chores

4.3.1 (2022-12-14)

Note: Version bump only for package gatsby-plugin-utils

4.3.0 (2022-12-13)

🧾 Release notes

Features

Bug Fixes

  • update minor and patch dependencies for gatsby-plugin-utils #37155 (8a874ed)

Chores

  • update dependency typescript to ^4.9.3 #37192 (204ed0e)
  • update dependency msw to ^0.49.1 for gatsby-plugin-utils #37188 (2ec7a92)

4.2.0 (2022-11-25)

🧾 Release notes

Chores

Other Changes

4.1.0 (2022-11-22)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

4.0.0 (2022-11-08)

🧾 Release notes

Chores

3.18.0 (2022-09-27)

🧾 Release notes

Features

  • Encrypt image cdn image/file urls when env vars are present #36585 (a341115)

Bug Fixes

3.17.1 (2022-09-22)

Features

3.17.0 (2022-09-13)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

3.16.0 (2022-08-30)

🧾 Release notes

Bug Fixes

Chores

3.15.0 (2022-08-16)

🧾 Release notes

Bug Fixes

Chores

Other Changes

3.14.0 (2022-08-02)

🧾 Release notes

Bug Fixes

Chores

3.13.0 (2022-07-19)

🧾 Release notes

Chores

  • update dependency msw to ^0.42.3 for gatsby-plugin-utils #36028 (2263c8c)

3.12.1 (2022-07-12)

Note: Version bump only for package gatsby-plugin-utils

3.12.0 (2022-07-05)

🧾 Release notes

Chores

  • update dependency msw to ^0.42.0 for gatsby-plugin-utils #35807 (ecff91d)

3.11.0 (2022-06-21)

🧾 Release notes

Features

3.10.0 (2022-06-07)

🧾 Release notes

Features

Bug Fixes

Chores

3.9.1 (2022-06-01)

Bug Fixes

3.9.0 (2022-05-24)

🧾 Release notes

Bug Fixes

  • Throw Typegen errors & add IGatsbyImageData to output #35683 (e7fc88b)

3.8.0 (2022-05-10)

🧾 Release notes

Bug Fixes

Chores

3.7.0 (2022-04-26)

🧾 Release notes

Features

3.6.1 (2022-04-13)

Note: Version bump only for package gatsby-plugin-utils

3.6.0 (2022-04-12)

🧾 Release notes

Bug Fixes

  • path pieces too long and url safe base64 encoding #35160 (3f12544)

Chores

  • update dependency msw to ^0.39.2 for gatsby-plugin-utils #35300 (aa0f61a)

3.5.1 (2022-03-31)

Note: Version bump only for package gatsby-plugin-utils

3.5.0 (2022-03-29)

🧾 Release notes

Features

Bug Fixes

3.4.2 (2022-03-23)

Note: Version bump only for package gatsby-plugin-utils

3.4.1 (2022-03-18)

Bug Fixes

3.4.0 (2022-03-16)

🧾 Release notes

Features

Bug Fixes

3.3.0 (2022-03-01)

🧾 Release notes

Chores

3.2.0 (2022-02-22)

🧾 Release notes

Features

3.1.0 (2022-02-08)

🧾 Release notes

Chores

3.0.0 (2022-01-25)

🧾 Release notes

Bug Fixes

  • don't throw on warnings in pluginOptionsSchema #34182 (252f50d)

2.5.0 (2022-01-11)

🧾 Release notes

Chores

2.4.0 (2021-12-14)

🧾 Release notes

Chores

2.3.0 (2021-12-01)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

2.2.0 (2021-11-16)

🧾 Release notes

Bug Fixes

Chores

2.1.1 (2021-11-09)

Bug Fixes

2.1.0 (2021-11-02)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

2.0.0 (2021-10-21)

🧾 Release notes

Bug Fixes

Chores

Other Changes

1.14.0 (2021-09-18)

🧾 Release notes

Features

Bug Fixes

  • update dependency joi to ^17.4.2 for gatsby-plugin-utils #32585 (ed8301e)

Chores

1.13.0 (2021-09-01)

🧾 Release notes

Chores

1.12.0 (2021-08-18)

🧾 Release notes

Chores

1.11.0 (2021-08-04)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

1.10.0 (2021-07-20)

🧾 Release notes

Bug Fixes

Chores

1.9.0 (2021-07-07)

🧾 Release notes

Features

  • add unstable_onPluginInit that would execute once in all processes #31901 (2bf8c0d)

1.8.0 (2021-06-23)

🧾 Release notes

Chores

1.7.1 (2021-06-10)

Chores

1.7.0 (2021-06-09)

🧾 Release notes

Chores

1.6.0 (2021-05-25)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

1.5.0 (2021-05-12)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

1.4.0 (2021-04-28)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

1.3.0 (2021-04-14)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

1.2.0 (2021-03-30)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

1.1.0 (2021-03-16)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

1.0.0 (2021-03-02)

🧾 Release notes

Chores

0.9.0 (2021-02-02)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

0.8.0 (2021-01-20)

🧾 Release notes

Chores

Other Changes

  • add file extension, fix code block, fix link, fix code fix #28905 (6736a6d)

0.7.0 (2021-01-06)

🧾 Release notes

Chores

0.6.0 (2020-12-15)

🧾 Release notes

Chores

0.5.0 (2020-12-02)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

0.4.0 (2020-11-20)

🧾 Release notes

Chores

0.3.0 (2020-11-12)

🧾 Release notes

Note: Version bump only for package gatsby-plugin-utils

0.2.40 (2020-10-28)

Bug Fixes

0.2.39 (2020-10-22)

Bug Fixes

  • gatsby-plugin-utils: skip libcheck during typegen (#27588) (0fdd3e9)

0.2.38 (2020-10-21)

Bug Fixes

  • duplicate types to solve circular dependency (#27578) (029ec48)
  • Update plugin schema testing util and associated tests (#27574) (6d81283)

0.2.37 (2020-10-20)

Note: Version bump only for package gatsby-plugin-utils

0.2.36 (2020-10-19)

Note: Version bump only for package gatsby-plugin-utils

0.2.35 (2020-10-19)

Features

  • gatsby-plugin-utils: save validation resulting value to plugin options (#27381) (0073fb1)

0.2.34 (2020-10-16)

Note: Version bump only for package gatsby-plugin-utils

0.2.33 (2020-10-16)

Note: Version bump only for package gatsby-plugin-utils

0.2.32 (2020-10-15)

Note: Version bump only for package gatsby-plugin-utils

0.2.31 (2020-10-14)

Note: Version bump only for package gatsby-plugin-utils

0.2.30 (2020-10-13)

Note: Version bump only for package gatsby-plugin-utils

0.2.29 (2020-10-13)

Note: Version bump only for package gatsby-plugin-utils

0.2.28 (2020-10-12)

Bug Fixes

Features

  • gatsby-plugin-utils: add testPluginOptionsSchema to verify plugin schema options (#27334) (6f842fb)

0.2.27 (2020-10-07)

Features

0.2.26 (2020-10-06)

Features

  • gatsby-plugin-utils: add package and methods to validate plugin options (#27164) (49e6669)