Skip to content

Commit c43c8d4

Browse files
authored
fix(hot-loader): alias react-dom to @hot-loader/react-dom in development (#117)
1 parent 15efb53 commit c43c8d4

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

gatsby-node.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,14 @@
44
* See: https://www.gatsbyjs.org/docs/node-apis/
55
*/
66

7-
// You can delete this file if you're not using it
7+
exports.onCreateWebpackConfig = ({ stage, actions }) => {
8+
if (stage.startsWith('develop')) {
9+
actions.setWebpackConfig({
10+
resolve: {
11+
alias: {
12+
'react-dom': '@hot-loader/react-dom',
13+
},
14+
},
15+
});
16+
}
17+
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"@commitlint/cli": "8.3.5",
7575
"@commitlint/config-conventional": "8.3.4",
7676
"@cypress/browserify-preprocessor": "2.1.4",
77+
"@hot-loader/react-dom": "16.11.0",
7778
"@testing-library/cypress": "5.3.0",
7879
"@types/color-string": "1.5.0",
7980
"@types/cypress-axe": "0.4.0",

yarn.lock

+18-8
Original file line numberDiff line numberDiff line change
@@ -2103,6 +2103,16 @@
21032103
dependencies:
21042104
"@hapi/hoek" "^8.3.0"
21052105

2106+
"@hot-loader/[email protected]":
2107+
version "16.11.0"
2108+
resolved "https://registry.yarnpkg.com/@hot-loader/react-dom/-/react-dom-16.11.0.tgz#c0b483923b289db5431516f56ee2a69448ebf9bd"
2109+
integrity sha512-cIOVB8YgT4EVCNiXK+gGuYl6adW/TKlW3N7GvgY5QgpL2NTWagF/oJxVscHSdR3O7NjJsoxdseB5spqwCHNIhA==
2110+
dependencies:
2111+
loose-envify "^1.1.0"
2112+
object-assign "^4.1.1"
2113+
prop-types "^15.6.2"
2114+
scheduler "^0.17.0"
2115+
21062116
"@jest/types@^24.9.0":
21072117
version "24.9.0"
21082118
resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59"
@@ -11297,7 +11307,6 @@ npm@^6.10.3:
1129711307
cmd-shim "^3.0.3"
1129811308
columnify "~1.5.4"
1129911309
config-chain "^1.1.12"
11300-
debuglog "*"
1130111310
detect-indent "~5.0.0"
1130211311
detect-newline "^2.1.0"
1130311312
dezalgo "~1.0.3"
@@ -11312,7 +11321,6 @@ npm@^6.10.3:
1131211321
has-unicode "~2.0.1"
1131311322
hosted-git-info "^2.8.5"
1131411323
iferr "^1.0.2"
11315-
imurmurhash "*"
1131611324
infer-owner "^1.0.4"
1131711325
inflight "~1.0.6"
1131811326
inherits "^2.0.4"
@@ -11331,14 +11339,8 @@ npm@^6.10.3:
1133111339
libnpx "^10.2.0"
1133211340
lock-verify "^2.1.0"
1133311341
lockfile "^1.0.4"
11334-
lodash._baseindexof "*"
1133511342
lodash._baseuniq "~4.6.0"
11336-
lodash._bindcallback "*"
11337-
lodash._cacheindexof "*"
11338-
lodash._createcache "*"
11339-
lodash._getnative "*"
1134011343
lodash.clonedeep "~4.5.0"
11341-
lodash.restparam "*"
1134211344
lodash.union "~4.6.0"
1134311345
lodash.uniq "~4.5.0"
1134411346
lodash.without "~4.4.0"
@@ -13810,6 +13812,14 @@ sax@^1.2.4, sax@~1.2.4:
1381013812
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
1381113813
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
1381213814

13815+
scheduler@^0.17.0:
13816+
version "0.17.0"
13817+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.17.0.tgz#7c9c673e4ec781fac853927916d1c426b6f3ddfe"
13818+
integrity sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA==
13819+
dependencies:
13820+
loose-envify "^1.1.0"
13821+
object-assign "^4.1.1"
13822+
1381313823
scheduler@^0.18.0:
1381413824
version "0.18.0"
1381513825
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.18.0.tgz#5901ad6659bc1d8f3fdaf36eb7a67b0d6746b1c4"

0 commit comments

Comments
 (0)