Skip to content

Commit b89c1b8

Browse files
authored
Merge pull request #7943 from ethereum/fix-code-splitting
Fix code splitting issue
2 parents 8f7ff0b + bb2556c commit b89c1b8

File tree

6 files changed

+79
-113
lines changed

6 files changed

+79
-113
lines changed

.babelrc

Lines changed: 0 additions & 16 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"unist-util-visit-parents": "^2.1.2"
7676
},
7777
"devDependencies": {
78-
"@netlify/functions": "^1.0.0",
78+
"@netlify/functions": "^1.2.0",
7979
"@types/browser-lang": "^0.1.0",
8080
"@types/github-slugger": "^1.3.0",
8181
"@types/luxon": "^2.3.2",
@@ -85,7 +85,7 @@
8585
"@types/react-dom": "^18.0.6",
8686
"@types/react-instantsearch-core": "^6.26.2",
8787
"@types/styled-system": "^5.1.15",
88-
"babel-preset-gatsby": "^2.14.0",
88+
"babel-preset-gatsby": "^2.23.0",
8989
"github-slugger": "^1.3.0",
9090
"gray-matter": "^4.0.3",
9191
"husky": "^4.2.5",
@@ -98,7 +98,7 @@
9898
},
9999
"scripts": {
100100
"build": "gatsby build",
101-
"build:lambda": "netlify-lambda build src/lambda",
101+
"build:lambda": "netlify-lambda build src/lambda --config=./webpack.lambda.js",
102102
"build:10gb": "NODE_OPTIONS=--max-old-space-size=10240 gatsby build",
103103
"clean": "gatsby clean",
104104
"crowdin-clean": "rm -rf .crowdin && mkdir .crowdin",
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
export * from "./Link"
2-
export * from "./Button"
3-
export * from "./Tag"
4-
export * from "./Modal"
1+
import { Button } from "./Button"
2+
import { Link } from "./Link"
3+
import { Tag } from "./Tag"
4+
import { Modal } from "./Modal"
5+
6+
export default {
7+
Button,
8+
Link,
9+
Tag,
10+
Modal,
11+
}

src/@chakra-ui/gatsby-plugin/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import styles from "./styles"
1111
import foundations from "./foundations"
1212

1313
// Component style overrides
14-
import * as components from "./components"
14+
import components from "./components"
1515

1616
import semanticTokens from "./semanticTokens"
1717

webpack.lambda.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Expose a custom webpack config in order to let netlify-lambda read it and
2+
// build the TS lambda functions. This way, netlify-lambda use the same
3+
// babel config that Gatsby does.
4+
module.exports = {
5+
module: {
6+
rules: [
7+
{
8+
test: /\.(m?js|ts)?$/,
9+
exclude: /(node_modules|bower_components)/,
10+
use: {
11+
loader: "babel-loader",
12+
options: {
13+
presets: [
14+
"@babel/preset-typescript",
15+
[
16+
"babel-preset-gatsby",
17+
{
18+
targets: {
19+
browsers: [">0.25%", "not dead"],
20+
},
21+
},
22+
],
23+
],
24+
},
25+
},
26+
},
27+
],
28+
},
29+
}

yarn.lock

Lines changed: 35 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -3919,10 +3919,10 @@
39193919
hey-listen "^1.0.8"
39203920
tslib "^2.3.1"
39213921

3922-
"@netlify/functions@^1.0.0":
3923-
version "1.0.0"
3924-
resolved "https://registry.yarnpkg.com/@netlify/functions/-/functions-1.0.0.tgz#5b6c02fafc567033c93b15a080cc021e5f10f254"
3925-
integrity sha512-7fnJv3vr8uyyyOYPChwoec6MjzsCw1CoRUO2DhQ1BD6bOyJRlD4DUaOOGlMILB2LCT8P24p5LexEGx8AJb7xdA==
3922+
"@netlify/functions@^1.2.0":
3923+
version "1.2.0"
3924+
resolved "https://registry.yarnpkg.com/@netlify/functions/-/functions-1.2.0.tgz#0acce06db94113d2a42253930c45cb69ab97c530"
3925+
integrity sha512-zCOJPoZQLv4ISHjyBS7asqzR6Y9NU+Vb0VKYDD0xUwYmReMhLTDchjGMkt5x0Jk1EVnJwUvA29rGyQEj3tIgAA==
39263926
dependencies:
39273927
is-promise "^4.0.0"
39283928

@@ -5886,10 +5886,10 @@ babel-preset-fbjs@^3.4.0:
58865886
"@babel/plugin-transform-template-literals" "^7.0.0"
58875887
babel-plugin-syntax-trailing-function-commas "^7.0.0-beta.0"
58885888

5889-
babel-preset-gatsby@^2.14.0:
5890-
version "2.14.0"
5891-
resolved "https://registry.yarnpkg.com/babel-preset-gatsby/-/babel-preset-gatsby-2.14.0.tgz#233b9de6ce8393e645914147c6a9624cb9b7d0f2"
5892-
integrity sha512-IqPgd15jJfJvqvX0i78JwLT48ctb7MdIEqHeKOuo4N8qWmyRIY8xX1IVhhSfDZ3eq62j0rVoqzT7ACUWctikmw==
5889+
babel-preset-gatsby@^2.21.0:
5890+
version "2.21.0"
5891+
resolved "https://registry.yarnpkg.com/babel-preset-gatsby/-/babel-preset-gatsby-2.21.0.tgz#14d431680d315c5cb62f76aa00ddef271a8b095e"
5892+
integrity sha512-L47zbDtFoCr2/vk/Z8Y+qTJW1CfzaWimXekN2cIr0G7Gp2JKqSe85m0aQ2417wkLZxYuAWtzHImTxUPGxA5FoA==
58935893
dependencies:
58945894
"@babel/plugin-proposal-class-properties" "^7.14.0"
58955895
"@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.5"
@@ -5904,13 +5904,13 @@ babel-preset-gatsby@^2.14.0:
59045904
babel-plugin-dynamic-import-node "^2.3.3"
59055905
babel-plugin-macros "^3.1.0"
59065906
babel-plugin-transform-react-remove-prop-types "^0.4.24"
5907-
gatsby-core-utils "^3.14.0"
5908-
gatsby-legacy-polyfills "^2.14.0"
5907+
gatsby-core-utils "^3.21.0"
5908+
gatsby-legacy-polyfills "^2.21.0"
59095909

5910-
babel-preset-gatsby@^2.21.0:
5911-
version "2.21.0"
5912-
resolved "https://registry.yarnpkg.com/babel-preset-gatsby/-/babel-preset-gatsby-2.21.0.tgz#14d431680d315c5cb62f76aa00ddef271a8b095e"
5913-
integrity sha512-L47zbDtFoCr2/vk/Z8Y+qTJW1CfzaWimXekN2cIr0G7Gp2JKqSe85m0aQ2417wkLZxYuAWtzHImTxUPGxA5FoA==
5910+
babel-preset-gatsby@^2.23.0:
5911+
version "2.23.0"
5912+
resolved "https://registry.yarnpkg.com/babel-preset-gatsby/-/babel-preset-gatsby-2.23.0.tgz#47482f6a9917455d3e9e0e5ce48c49b44d6d000d"
5913+
integrity sha512-Mo5Dnrox1d/rJq8cJ2mv1+SNASVmpB+3LMiQKIGky5B1jCMhNtUoMPmJh2Pq29be8dwngL/GG853YFfZn9U62A==
59145914
dependencies:
59155915
"@babel/plugin-proposal-class-properties" "^7.14.0"
59165916
"@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.5"
@@ -5925,8 +5925,8 @@ babel-preset-gatsby@^2.21.0:
59255925
babel-plugin-dynamic-import-node "^2.3.3"
59265926
babel-plugin-macros "^3.1.0"
59275927
babel-plugin-transform-react-remove-prop-types "^0.4.24"
5928-
gatsby-core-utils "^3.21.0"
5929-
gatsby-legacy-polyfills "^2.21.0"
5928+
gatsby-core-utils "^3.23.0"
5929+
gatsby-legacy-polyfills "^2.23.0"
59305930

59315931
backo2@^1.0.2, backo2@~1.0.2:
59325932
version "1.0.2"
@@ -9392,31 +9392,31 @@ gatsby-core-utils@^2.2.0:
93929392
tmp "^0.2.1"
93939393
xdg-basedir "^4.0.0"
93949394

9395-
gatsby-core-utils@^3.14.0:
9396-
version "3.15.0"
9397-
resolved "https://registry.yarnpkg.com/gatsby-core-utils/-/gatsby-core-utils-3.15.0.tgz#1fb6611765250c187dd6d36c2812a5b0c50204ae"
9398-
integrity sha512-aLNrH3gGUIeD9XGk3z/27N5qaVx7y3AAgs/Vu6PJm69t25kTwuOHKNzhlnHkIZypznZkkVeN7QbHBkIKam/ZIQ==
9395+
gatsby-core-utils@^3.20.0, gatsby-core-utils@^3.21.0, gatsby-core-utils@^3.5.2:
9396+
version "3.21.0"
9397+
resolved "https://registry.yarnpkg.com/gatsby-core-utils/-/gatsby-core-utils-3.21.0.tgz#5ca118857cf9f59b69f06f2ae886d8182af46515"
9398+
integrity sha512-pCDa9EGU8niRJQVv7ow3ijzmG0PegZaBc5Yt6z4enc4m7Dl5ZT6Edkcw9p8q/FhGiZUkzQhWaRDxUvtaoPwAOQ==
93999399
dependencies:
94009400
"@babel/runtime" "^7.15.4"
94019401
ci-info "2.0.0"
94029402
configstore "^5.0.1"
94039403
fastq "^1.13.0"
94049404
file-type "^16.5.3"
94059405
fs-extra "^10.1.0"
9406-
got "^11.8.3"
9406+
got "^11.8.5"
94079407
import-from "^4.0.0"
9408-
lmdb "2.3.10"
9408+
lmdb "2.5.3"
94099409
lock "^1.1.0"
94109410
node-object-hash "^2.3.10"
94119411
proper-lockfile "^4.1.2"
94129412
resolve-from "^5.0.0"
94139413
tmp "^0.2.1"
94149414
xdg-basedir "^4.0.0"
94159415

9416-
gatsby-core-utils@^3.20.0, gatsby-core-utils@^3.21.0, gatsby-core-utils@^3.5.2:
9417-
version "3.21.0"
9418-
resolved "https://registry.yarnpkg.com/gatsby-core-utils/-/gatsby-core-utils-3.21.0.tgz#5ca118857cf9f59b69f06f2ae886d8182af46515"
9419-
integrity sha512-pCDa9EGU8niRJQVv7ow3ijzmG0PegZaBc5Yt6z4enc4m7Dl5ZT6Edkcw9p8q/FhGiZUkzQhWaRDxUvtaoPwAOQ==
9416+
gatsby-core-utils@^3.23.0:
9417+
version "3.23.0"
9418+
resolved "https://registry.yarnpkg.com/gatsby-core-utils/-/gatsby-core-utils-3.23.0.tgz#0c8879ffb655f2d8cfe485f03beed7db6441dc69"
9419+
integrity sha512-ABVTAkjZh+2H4u6GZ+r1uZrdcWuT5KG2nEpKmBWBp21GWEE+yvUqtGOocBgUeGac1A3ggvn02UzcE6BIEm9PYg==
94209420
dependencies:
94219421
"@babel/runtime" "^7.15.4"
94229422
ci-info "2.0.0"
@@ -9441,14 +9441,6 @@ gatsby-graphiql-explorer@^2.21.0:
94419441
dependencies:
94429442
"@babel/runtime" "^7.15.4"
94439443

9444-
gatsby-legacy-polyfills@^2.14.0:
9445-
version "2.14.0"
9446-
resolved "https://registry.yarnpkg.com/gatsby-legacy-polyfills/-/gatsby-legacy-polyfills-2.14.0.tgz#83e8fa3b395e5e75ee8e094275ee759ae7d570bd"
9447-
integrity sha512-OcJrY9eqiHtU8bi1zOiaO+wXZv+W/HOR0oP+5IvmWBIiLl4M+ln/z6PJcqk2fnfIK51zyzARvhPXAakDs5JE4w==
9448-
dependencies:
9449-
"@babel/runtime" "^7.15.4"
9450-
core-js-compat "3.9.0"
9451-
94529444
gatsby-legacy-polyfills@^2.21.0:
94539445
version "2.21.0"
94549446
resolved "https://registry.yarnpkg.com/gatsby-legacy-polyfills/-/gatsby-legacy-polyfills-2.21.0.tgz#f3a387c72c2f9bd5b8fc406a0c879603fa0d4b5e"
@@ -9457,6 +9449,14 @@ gatsby-legacy-polyfills@^2.21.0:
94579449
"@babel/runtime" "^7.15.4"
94589450
core-js-compat "3.9.0"
94599451

9452+
gatsby-legacy-polyfills@^2.23.0:
9453+
version "2.23.0"
9454+
resolved "https://registry.yarnpkg.com/gatsby-legacy-polyfills/-/gatsby-legacy-polyfills-2.23.0.tgz#f527aea9d90932ad7f1ef7fd0a6aa260a1abb48a"
9455+
integrity sha512-DQexce/ezAU47bd5X5JnwIBdvr7MAJsRXzV3bhWuQhslkWJOp0l6O3EQ148s8Ezu6g66JOre5iKvSvor6qvU6Q==
9456+
dependencies:
9457+
"@babel/runtime" "^7.15.4"
9458+
core-js-compat "3.9.0"
9459+
94609460
gatsby-link@^4.21.0:
94619461
version "4.21.0"
94629462
resolved "https://registry.yarnpkg.com/gatsby-link/-/gatsby-link-4.21.0.tgz#da2c8b7e9bd49ad52fe9d9b9d9521eac5d25f81e"
@@ -10318,7 +10318,7 @@ good-listener@^1.2.2:
1031810318
dependencies:
1031910319
delegate "^3.1.2"
1032010320

10321-
got@^11.8.2, got@^11.8.3:
10321+
got@^11.8.2:
1032210322
version "11.8.3"
1032310323
resolved "https://registry.yarnpkg.com/got/-/got-11.8.3.tgz#f496c8fdda5d729a90b4905d2b07dbd148170770"
1032410324
integrity sha512-7gtQ5KiPh1RtGS9/Jbv1ofDpBFuq42gyfEib+ejaRBJuj/3tQFeR5+gw57e4ipaU8c/rCjvX6fkQz2lyDlGAOg==
@@ -11905,55 +11905,6 @@ lines-and-columns@^1.1.6:
1190511905
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
1190611906
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
1190711907

11908-
lmdb-darwin-arm64@2.3.10:
11909-
version "2.3.10"
11910-
resolved "https://registry.yarnpkg.com/lmdb-darwin-arm64/-/lmdb-darwin-arm64-2.3.10.tgz#4e20f75770eeedc60af3d4630975fd105a89ffe8"
11911-
integrity sha512-LVXbH2MYu7/ZuQ8+P9rv+SwNyBKltxo7vHAGJS94HWyfwnCbKEYER9PImBvNBwzvgtaYk6x0RMX3oor6e6KdDQ==
11912-
11913-
lmdb-darwin-x64@2.3.10:
11914-
version "2.3.10"
11915-
resolved "https://registry.yarnpkg.com/lmdb-darwin-x64/-/lmdb-darwin-x64-2.3.10.tgz#e53637a6735488eaa15feb7c0e9da142015b9476"
11916-
integrity sha512-gAc/1b/FZOb9yVOT+o0huA+hdW82oxLo5r22dFTLoRUFG1JMzxdTjmnW6ONVOHdqC9a5bt3vBCEY3jmXNqV26A==
11917-
11918-
lmdb-linux-arm64@2.3.10:
11919-
version "2.3.10"
11920-
resolved "https://registry.yarnpkg.com/lmdb-linux-arm64/-/lmdb-linux-arm64-2.3.10.tgz#ac7db8bdfe0e9dbf2be1cc3362d6f2b79e2a9722"
11921-
integrity sha512-Ihr8mdICTK3jA4GXHxrXGK2oekn0mY6zuDSXQDNtyRSH19j3D2Y04A7SEI9S0EP/t5sjKSudYgZbiHDxRCsI5A==
11922-
11923-
lmdb-linux-arm@2.3.10:
11924-
version "2.3.10"
11925-
resolved "https://registry.yarnpkg.com/lmdb-linux-arm/-/lmdb-linux-arm-2.3.10.tgz#74235418bbe7bf41e8ea5c9d52365c4ff5ca4b49"
11926-
integrity sha512-Rb8+4JjsThuEcJ7GLLwFkCFnoiwv/3hAAbELWITz70buQFF+dCZvCWWgEgmDTxwn5r+wIkdUjmFv4dqqiKQFmQ==
11927-
11928-
lmdb-linux-x64@2.3.10:
11929-
version "2.3.10"
11930-
resolved "https://registry.yarnpkg.com/lmdb-linux-x64/-/lmdb-linux-x64-2.3.10.tgz#d790b95061d03c5c99a57b3ad5126f7723c60a2f"
11931-
integrity sha512-E3l3pDiCA9uvnLf+t3qkmBGRO01dp1EHD0x0g0iRnfpAhV7wYbayJGfG93BUt22Tj3fnq4HDo4dQ6ZWaDI1nuw==
11932-
11933-
lmdb-win32-x64@2.3.10:
11934-
version "2.3.10"
11935-
resolved "https://registry.yarnpkg.com/lmdb-win32-x64/-/lmdb-win32-x64-2.3.10.tgz#bff73d12d94084343c569b16069d8d38626eb2d6"
11936-
integrity sha512-gspWk34tDANhjn+brdqZstJMptGiwj4qFNVg0Zey9ds+BUlif+Lgf5szrfOVzZ8gVRkk1Lgbz7i78+V7YK7SCA==
11937-
11938-
lmdb@2.3.10:
11939-
version "2.3.10"
11940-
resolved "https://registry.yarnpkg.com/lmdb/-/lmdb-2.3.10.tgz#640fc60815846babcbe088d7f8ed0a51da857f6a"
11941-
integrity sha512-GtH+nStn9V59CfYeQ5ddx6YTfuFCmu86UJojIjJAweG+/Fm0PDknuk3ovgYDtY/foMeMdZa8/P7oSljW/d5UPw==
11942-
dependencies:
11943-
msgpackr "^1.5.4"
11944-
nan "^2.14.2"
11945-
node-addon-api "^4.3.0"
11946-
node-gyp-build-optional-packages "^4.3.2"
11947-
ordered-binary "^1.2.4"
11948-
weak-lru-cache "^1.2.2"
11949-
optionalDependencies:
11950-
lmdb-darwin-arm64 "2.3.10"
11951-
lmdb-darwin-x64 "2.3.10"
11952-
lmdb-linux-arm "2.3.10"
11953-
lmdb-linux-arm64 "2.3.10"
11954-
lmdb-linux-x64 "2.3.10"
11955-
lmdb-win32-x64 "2.3.10"
11956-
1195711908
lmdb@2.5.2:
1195811909
version "2.5.2"
1195911910
resolved "https://registry.yarnpkg.com/lmdb/-/lmdb-2.5.2.tgz#37e28a9fb43405f4dc48c44cec0e13a14c4a6ff1"
@@ -13069,11 +13020,6 @@ node-gyp-build-optional-packages@5.0.3:
1306913020
resolved "https://registry.yarnpkg.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.3.tgz#92a89d400352c44ad3975010368072b41ad66c17"
1307013021
integrity sha512-k75jcVzk5wnnc/FMxsf4udAoTEUv2jY3ycfdSd3yWu6Cnd1oee6/CfZJApyscA4FJOmdoixWwiwOyf16RzD5JA==
1307113022

13072-
node-gyp-build-optional-packages@^4.3.2:
13073-
version "4.3.2"
13074-
resolved "https://registry.yarnpkg.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-4.3.2.tgz#82de9bdf9b1ad042457533afb2f67469dc2264bb"
13075-
integrity sha512-P5Ep3ISdmwcCkZIaBaQamQtWAG0facC89phWZgi5Z3hBU//J6S48OIvyZWSPPf6yQMklLZiqoosWAZUj7N+esA==
13076-
1307713023
node-gyp-build@^4.2.3:
1307813024
version "4.3.0"
1307913025
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3"

0 commit comments

Comments
 (0)