@escaladesports/babel-preset
v2.7.0
Published
Escalade Sport's babel preset
Downloads
21
Readme
@escaladesports/babel-preset
Official Escalade Sports Babel preset
Bundles together several common Babel plugins/presets, including:
- @babel/preset-env
- @babel/preset-react
- @babel/plugin-transform-runtime
- @babel/plugin-syntax-dynamic-import
- @babel/plugin-proposal-optional-chaining
- babel-plugin-dynamic-import-node (disabled for Gatsby sites – see below)
- ...among several others
Usage with Gatsby
To use this preset with Gatsby sites, a custom .babelrc
file must include babel-preset-gatsby and specify "gatsby": true
in the options for this preset. The former is required any time a custom Babel config is used on a Gatsby site, and not doing the latter will cause build failures if the Gatsby site is also using loadable components and dynamic import
statements.
The .babelrc
should look like this:
{
"presets": [
"babel-preset-gatsby",
[
"@escaladesports/babel-preset",
{
"gatsby": true
}
]
]
}