Skip to content

Commit

Permalink
fix(gatsby-plugin-preact): use new babel plugin for better context co…
Browse files Browse the repository at this point in the history
…mpat (#26956)

* use new babel plugin for better context compat

* Update gatsby-node.js

* Update gatsby-node.js

Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
  • Loading branch information
JoviDeCroock and gatsbybot committed Sep 25, 2020
1 parent b7d76d3 commit 7f38209
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/gatsby-plugin-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"url": "https://github.com/gatsbyjs/gatsby/issues"
},
"dependencies": {
"@prefresh/webpack": "^1.0.2",
"react-refresh": "^0.8.2"
"@prefresh/webpack": "^1.0.2"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-preact/src/__tests__/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe(`gatsby-plugin-preact`, () => {
expect(getConfig).toHaveBeenCalledTimes(1)
expect(actions.setBabelPlugin).toHaveBeenCalledTimes(1)
expect(actions.setBabelPlugin).toHaveBeenCalledWith({
name: `react-refresh/babel`,
name: `@prefresh/babel-plugin`,
})
expect(actions.replaceWebpackConfig).toMatchInlineSnapshot(`
[MockFunction] {
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-preact/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => {
// enable react-refresh babel plugin to enable hooks
// @see https://github.com/JoviDeCroock/prefresh/tree/master/packages/webpack#using-hooks
actions.setBabelPlugin({
name: `react-refresh/babel`,
name: `@prefresh/babel-plugin`,
})
}

Expand Down

0 comments on commit 7f38209

Please sign in to comment.