Skip to content

Commit c5a6a24

Browse files
committed
Bundle client deps
1 parent 128998f commit c5a6a24

File tree

3 files changed

+68
-12
lines changed

3 files changed

+68
-12
lines changed

packages/mdx/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,29 @@
3838
"coverage": "vitest run --coverage"
3939
},
4040
"dependencies": {
41-
"@codesandbox/sandpack-client": "^0.1.20",
42-
"diff": "^4.0.2",
4341
"hast-util-to-estree": "^1.4.0",
4442
"is-plain-obj": "^3.0.0",
4543
"node-fetch": "^2.0.0",
4644
"remark-rehype": "^8.1.0",
4745
"shiki": "^0.10.1",
4846
"unified": "^9.2.2",
4947
"unist-util-visit": "^2.0.0",
50-
"unist-util-visit-parents": "^3.0.0",
51-
"use-spring": "^0.2.3"
48+
"unist-util-visit-parents": "^3.0.0"
5249
},
5350
"devDependencies": {
51+
"@codesandbox/sandpack-client": "^0.19.0",
5452
"@mdx-js/mdx": "^2.0.0",
53+
"@rollup/plugin-commonjs": "^21.1.0",
5554
"@rollup/plugin-json": "^4.1.0",
55+
"@rollup/plugin-node-resolve": "^13.2.1",
5656
"@rollup/plugin-replace": "^4.0.0",
5757
"@types/diff": "^5.0.2",
5858
"@types/node": "^17.0.21",
5959
"@types/node-fetch": "^2.6.1",
6060
"@types/react": "^17.0.39",
6161
"autoprefixer": "^9.8.2",
6262
"cssnano": "^4.1.10",
63+
"diff": "^4.0.2",
6364
"esbuild": "^0.13.2",
6465
"mdx-bundler": "^8.0.1",
6566
"mdx-debugger": "^0.2.0",
@@ -73,6 +74,7 @@
7374
"rollup-plugin-typescript2": "^0.27.1",
7475
"sass": "^1.49.9",
7576
"typescript": "^4.6.2",
77+
"use-spring": "^0.2.3",
7678
"vite": "^2.8.6",
7779
"vitest": "^0.5.9"
7880
},

packages/mdx/rollup.config.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ import path from "path"
88
import json from "@rollup/plugin-json"
99
import del from "rollup-plugin-delete"
1010
import replace from "@rollup/plugin-replace"
11+
import { nodeResolve } from "@rollup/plugin-node-resolve"
1112
// import { terser } from "rollup-plugin-terser"
13+
import commonjs from "@rollup/plugin-commonjs"
1214

1315
const clientExternal = [
1416
"react",
15-
"@codesandbox/sandpack-client",
16-
"use-spring",
17-
"diff",
17+
"react-dom",
18+
// "@codesandbox/sandpack-client",
19+
// "use-spring",
20+
// "diff",
1821
]
1922
const remarkExternal = [
2023
"react",
@@ -112,6 +115,8 @@ export default function makeConfig(commandOptions) {
112115
],
113116
external: clientExternal,
114117
plugins: [
118+
nodeResolve(),
119+
commonjs(),
115120
json({ compact: true }),
116121
typescript({
117122
tsconfigOverride: {

yarn.lock

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,10 +1385,10 @@
13851385
"@babel/helper-validator-identifier" "^7.16.7"
13861386
to-fast-properties "^2.0.0"
13871387

1388-
"@codesandbox/sandpack-client@^0.1.20":
1389-
version "0.1.20"
1390-
resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-client/-/sandpack-client-0.1.20.tgz#4b6c618e223a5ffdc6a82f266e7391fd3a91f15a"
1391-
integrity sha512-FlX1AfZwHWJmdeTMZkNdW0YM6sGO+lp9sBwVlxwF4zxq/ki8kGqXJzo326XzjZ5WXQHbWigppjtgyya4BhJy+Q==
1388+
"@codesandbox/sandpack-client@^0.19.0":
1389+
version "0.19.0"
1390+
resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-client/-/sandpack-client-0.19.0.tgz#e37bdb06dc2c349d44970b344f66799867229e5f"
1391+
integrity sha512-Ar6GIh1MagsEwLAcn4rJqZgjT4WLn2wvfjDISNch+eIzaB2P1u0+4XMIOItVdCN21NIK5TAYsg4t0S0D77IzmA==
13921392
dependencies:
13931393
codesandbox-import-utils "^1.2.3"
13941394
lodash.isequal "^4.5.0"
@@ -3029,13 +3029,38 @@
30293029
set-cookie-parser "^2.4.8"
30303030
source-map "^0.7.3"
30313031

3032+
"@rollup/plugin-commonjs@^21.1.0":
3033+
version "21.1.0"
3034+
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-21.1.0.tgz#45576d7b47609af2db87f55a6d4b46e44fc3a553"
3035+
integrity sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA==
3036+
dependencies:
3037+
"@rollup/pluginutils" "^3.1.0"
3038+
commondir "^1.0.1"
3039+
estree-walker "^2.0.1"
3040+
glob "^7.1.6"
3041+
is-reference "^1.2.1"
3042+
magic-string "^0.25.7"
3043+
resolve "^1.17.0"
3044+
30323045
"@rollup/plugin-json@^4.1.0":
30333046
version "4.1.0"
30343047
resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3"
30353048
integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==
30363049
dependencies:
30373050
"@rollup/pluginutils" "^3.0.8"
30383051

3052+
"@rollup/plugin-node-resolve@^13.2.1":
3053+
version "13.2.1"
3054+
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.2.1.tgz#cdee815cf02c180ff0a42536ca67a8f67e299f84"
3055+
integrity sha512-btX7kzGvp1JwShQI9V6IM841YKNPYjKCvUbNrQ2EcVYbULtUd/GH6wZ/qdqH13j9pOHBER+EZXNN2L8RSJhVRA==
3056+
dependencies:
3057+
"@rollup/pluginutils" "^3.1.0"
3058+
"@types/resolve" "1.17.1"
3059+
builtin-modules "^3.1.0"
3060+
deepmerge "^4.2.2"
3061+
is-module "^1.0.0"
3062+
resolve "^1.19.0"
3063+
30393064
"@rollup/plugin-replace@^4.0.0":
30403065
version "4.0.0"
30413066
resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-4.0.0.tgz#e34c457d6a285f0213359740b43f39d969b38a67"
@@ -3574,6 +3599,13 @@
35743599
"@types/scheduler" "*"
35753600
csstype "^3.0.2"
35763601

3602+
3603+
version "1.17.1"
3604+
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6"
3605+
integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==
3606+
dependencies:
3607+
"@types/node" "*"
3608+
35773609
"@types/resolve@^1.17.1":
35783610
version "1.20.1"
35793611
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.1.tgz#3727e48042fda81e374f5d5cf2fa92288bf698f8"
@@ -4566,6 +4598,11 @@ buffer@^5.2.1:
45664598
base64-js "^1.3.1"
45674599
ieee754 "^1.1.13"
45684600

4601+
builtin-modules@^3.1.0:
4602+
version "3.2.0"
4603+
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887"
4604+
integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==
4605+
45694606
builtins@^1.0.3:
45704607
version "1.0.3"
45714608
resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88"
@@ -8916,6 +8953,11 @@ is-lambda@^1.0.1:
89168953
resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5"
89178954
integrity sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=
89188955

8956+
is-module@^1.0.0:
8957+
version "1.0.0"
8958+
resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591"
8959+
integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=
8960+
89198961
is-natural-number@^4.0.1:
89208962
version "4.0.1"
89218963
resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8"
@@ -9000,6 +9042,13 @@ is-plain-object@^5.0.0:
90009042
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344"
90019043
integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==
90029044

9045+
is-reference@^1.2.1:
9046+
version "1.2.1"
9047+
resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7"
9048+
integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==
9049+
dependencies:
9050+
"@types/estree" "*"
9051+
90039052
is-reference@^3.0.0:
90049053
version "3.0.0"
90059054
resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-3.0.0.tgz#b1380c03d96ddf7089709781e3208fceb0c92cd6"
@@ -13461,7 +13510,7 @@ [email protected]:
1346113510
dependencies:
1346213511
path-parse "^1.0.6"
1346313512

13464-
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.22.0, resolve@^1.3.2:
13513+
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.22.0, resolve@^1.3.2:
1346513514
version "1.22.0"
1346613515
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198"
1346713516
integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==

0 commit comments

Comments
 (0)