Official Babel preset for Gatsby projects, providing a curated set of plugins and presets to enable modern JavaScript and React support while targeting older browsers and Node.js. Current stable version is 3.16.0, released as part of Gatsby 5.x ecosystem. Release cadence follows Gatsby major releases. Key features include automatic polyfilling via core-js, optimized production builds with plugin-transform-react-remove-prop-types, and support for both classic and automatic JSX runtime. Differs from generic Babel presets by being tuned specifically for Gatsby's build pipeline, including optimizations like hook destructuring and dynamic import syntax.
npm install babel-preset-gatsbyVerified import paths — ran on the pinned version, not inferred.
Shows how to use babel-preset-gatsby in a .babelrc file, with optional configuration.
Upgrade to Gatsby 5.x and Node >=18.
Remove explicit dependency unless you need custom Babel config.
Run 'npm install core-js@3' in your project.
Only override targets if you fully understand the implications for browser support.
Run 'npm install babel-preset-gatsby' or ensure it's in dependencies.
Add '@babel/plugin-transform-runtime' to Babel plugins, or ensure core-js is installed.
Use array syntax: ['babel-preset-gatsby', { options }].