Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including babel-preset-gatsby with all npm packages installed. Try it out:

require("@babel/core/package.json"); // @babel/core is a peer dependency. require("core-js/package.json"); // core-js is a peer dependency. var babelPresetGatsby = require("babel-preset-gatsby")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

babel-preset-gatsby v0.5.5

babel-preset-gatsby

Gatsby uses the phenomenal project Babel to enable support for writing modern JavaScript — while still supporting older browsers. This package contains the default Babel setup for all Gatsby projects.

For more information on how to customize the Babel configuration of your Gatsby site, check out our documentation.

Packages

Usage

Install babel-preset-gatsby and add a .babelrc file with the following content to the root of your project:

npm install --dev babel-preset-gatsby
{
  "presets": ["babel-preset-gatsby"]
}

Options

targets

{ [string]: number | string }, defaults to { "browsers": ["last 4 versions", "safari >= 7", "ie >= 9"] } in production and { "browsers": ["last 2 versions", "not ie <= 11", "not android 4.4.3"] } in development when targeting the browser and { "node": 6 } in production and { "node": "current" } in development when targeting Node.js.

Use this option to configure custom target browsers.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free