Skip to content

Commit

Permalink
fix: use proper babelrc configs for compiling packages (#35948)
Browse files Browse the repository at this point in the history
  • Loading branch information
wardpeet committed Jun 20, 2022
1 parent e713690 commit 384e801
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-link/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": [["babel-preset-gatsby-package", { "browser": true }]]
"presets": [["babel-preset-gatsby-package", { "browser": true, "esm": true }]]
}
6 changes: 3 additions & 3 deletions packages/gatsby-page-utils/.babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"presets": [["babel-preset-gatsby-package", { "browser": true }]],
"presets": [["babel-preset-gatsby-package"]],
"overrides": [
{
"test": ["**/*.ts"],
"plugins": [["@babel/plugin-transform-typescript"]]
"test": "src/apply-trailing-slash-options.ts",
"presets": [["babel-preset-gatsby-package", { "browser": true }]]
}
]
}
8 changes: 7 additions & 1 deletion packages/gatsby-plugin-canonical-urls/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"presets": [["babel-preset-gatsby-package", { "browser": true }]]
"presets": [["babel-preset-gatsby-package", { "browser": true, "esm": true }]],
"overrides": [
{
"test": ["src/gatsby-node.js"],
"presets": [["babel-preset-gatsby-package"]]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exports.onRouteUpdate = (
export const onRouteUpdate = (
{ location },
pluginOptions = { stripQueryString: false }
) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-canonical-urls/src/gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import url from "url"

exports.onRenderBody = (
export const onRenderBody = (
{ setHeadComponents, pathname = `/` },
pluginOptions
) => {
Expand Down
8 changes: 7 additions & 1 deletion packages/gatsby-plugin-catch-links/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"presets": [["babel-preset-gatsby-package", { "browser": true }]]
"presets": [["babel-preset-gatsby-package", { "browser": true, "esm": true }]],
"overrides": [
{
"test": ["src/gatsby-node.js"],
"presets": [["babel-preset-gatsby-package"]]
}
]
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-catch-links/src/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { navigate } from "gatsby"

import catchLinks from "./catch-links"

exports.onClientEntry = (_, pluginOptions = {}) => {
export const onClientEntry = (_, pluginOptions = {}) => {
catchLinks(window, pluginOptions, href => {
navigate(href)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-facebook-analytics/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": [["babel-preset-gatsby-package", { "browser": true }]]
"presets": [["babel-preset-gatsby-package", { "browser": true, "esm": true }]]
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-page-creator/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": [["babel-preset-gatsby-package", { "browser": true }]]
"presets": [["babel-preset-gatsby-package"]]
}

0 comments on commit 384e801

Please sign in to comment.