Skip to content

Commit 3352b76

Browse files
committed
build: Use rolldown for bundles
1 parent cbfe594 commit 3352b76

File tree

6 files changed

+154
-8
lines changed

6 files changed

+154
-8
lines changed

dev-packages/rollup-utils/bundleHelpers.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const BUNDLE_VARIANTS = ['.js', '.min.js', '.debug.min.js'];
2525

2626
export function makeBaseBundleConfig(options) {
2727
const { bundleType, entrypoints, licenseTitle, outputFileBase, packageSpecificConfig, sucrase } = options;
28+
const rolldown = process.argv[1]?.endsWith('rolldown');
2829

2930
const nodeResolvePlugin = makeNodeResolvePlugin();
3031
const sucrasePlugin = makeSucrasePlugin({}, sucrase);
@@ -133,11 +134,13 @@ export function makeBaseBundleConfig(options) {
133134
entryFileNames: outputFileBase,
134135
dir: 'build',
135136
sourcemap: true,
136-
strict: false,
137+
...(rolldown ? {} : {strict: false}),
137138
esModule: false,
138139
},
139-
plugins: [sucrasePlugin, nodeResolvePlugin, cleanupPlugin, licensePlugin],
140-
treeshake: 'smallest',
140+
plugins: rolldown
141+
? [cleanupPlugin, licensePlugin]
142+
: [sucrasePlugin, nodeResolvePlugin, cleanupPlugin, licensePlugin],
143+
treeshake: rolldown ? true : 'smallest',
141144
};
142145

143146
const bundleTypeConfigMap = {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
"prettier": "^3.1.1",
126126
"rimraf": "^5.0.10",
127127
"rollup": "^4.35.0",
128+
"rolldown": "^1.0.0-beta.8",
128129
"rollup-plugin-cleanup": "^3.2.1",
129130
"rollup-plugin-license": "^3.3.1",
130131
"size-limit": "~11.1.6",

packages/browser/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@
5252
"scripts": {
5353
"build": "run-p build:transpile build:bundle build:types",
5454
"build:dev": "run-p build:transpile build:types",
55-
"build:bundle": "rollup -c rollup.bundle.config.mjs",
55+
"build:bundle": "rolldown -c rollup.bundle.config.mjs",
5656
"build:transpile": "rollup -c rollup.npm.config.mjs",
5757
"build:types": "run-s build:types:core build:types:downlevel",
5858
"build:types:core": "tsc -p tsconfig.types.json",
5959
"build:types:downlevel": "yarn downlevel-dts build/npm/types build/npm/types-ts3.8 --to ts3.8",
6060
"build:watch": "run-p build:transpile:watch build:bundle:watch build:types:watch",
6161
"build:dev:watch": "run-p build:transpile:watch build:types:watch",
62-
"build:bundle:watch": "rollup -c rollup.bundle.config.mjs --watch",
62+
"build:bundle:watch": "rolldown -c rollup.bundle.config.mjs --watch",
6363
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
6464
"build:types:watch": "tsc -p tsconfig.types.json --watch",
6565
"build:tarball": "npm pack",

packages/replay-canvas/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"scripts": {
3333
"build": "run-p build:transpile build:types build:bundle",
3434
"build:transpile": "rollup -c rollup.npm.config.mjs",
35-
"build:bundle": "rollup -c rollup.bundle.config.mjs",
35+
"build:bundle": "rolldown -c rollup.bundle.config.mjs",
3636
"build:dev": "run-p build:transpile build:types",
3737
"build:types": "run-s build:types:core build:types:downlevel",
3838
"build:types:core": "tsc -p tsconfig.types.json",

packages/replay-internal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"scripts": {
3636
"build": "run-p build:transpile build:types build:bundle",
3737
"build:transpile": "rollup -c rollup.npm.config.mjs",
38-
"build:bundle": "rollup -c rollup.bundle.config.mjs",
38+
"build:bundle": "rolldown -c rollup.bundle.config.mjs",
3939
"build:dev": "run-p build:transpile build:types",
4040
"build:types": "run-s build:types:core build:types:downlevel",
4141
"build:types:core": "tsc -p tsconfig.types.json",

yarn.lock

Lines changed: 143 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2932,6 +2932,28 @@
29322932
lodash "^4.17.21"
29332933
resolve "^1.20.0"
29342934

2935+
"@emnapi/core@^1.4.0":
2936+
version "1.4.3"
2937+
resolved "https://registry.yarnpkg.com/@emnapi/core/-/core-1.4.3.tgz#9ac52d2d5aea958f67e52c40a065f51de59b77d6"
2938+
integrity sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g==
2939+
dependencies:
2940+
"@emnapi/wasi-threads" "1.0.2"
2941+
tslib "^2.4.0"
2942+
2943+
"@emnapi/runtime@^1.4.0":
2944+
version "1.4.3"
2945+
resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.4.3.tgz#c0564665c80dc81c448adac23f9dfbed6c838f7d"
2946+
integrity sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ==
2947+
dependencies:
2948+
tslib "^2.4.0"
2949+
2950+
2951+
version "1.0.2"
2952+
resolved "https://registry.yarnpkg.com/@emnapi/wasi-threads/-/wasi-threads-1.0.2.tgz#977f44f844eac7d6c138a415a123818c655f874c"
2953+
integrity sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA==
2954+
dependencies:
2955+
tslib "^2.4.0"
2956+
29352957
"@esbuild-plugins/node-globals-polyfill@^0.2.3":
29362958
version "0.2.3"
29372959
resolved "https://registry.yarnpkg.com/@esbuild-plugins/node-globals-polyfill/-/node-globals-polyfill-0.2.3.tgz#0e4497a2b53c9e9485e149bc92ddb228438d6bcf"
@@ -4604,6 +4626,15 @@
46044626
dependencies:
46054627
sparse-bitfield "^3.0.3"
46064628

4629+
"@napi-rs/wasm-runtime@^0.2.4":
4630+
version "0.2.9"
4631+
resolved "https://registry.yarnpkg.com/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.9.tgz#7278122cf94f3b36d8170a8eee7d85356dfa6a96"
4632+
integrity sha512-OKRBiajrrxB9ATokgEQoG87Z25c67pCpYcCwmXYX8PBftC9pBfN18gnm/fh1wurSLEKIAt+QRFLFCQISrb66Jg==
4633+
dependencies:
4634+
"@emnapi/core" "^1.4.0"
4635+
"@emnapi/runtime" "^1.4.0"
4636+
"@tybys/wasm-util" "^0.9.0"
4637+
46074638
46084639
version "11.0.16"
46094640
resolved "https://registry.yarnpkg.com/@nestjs/common/-/common-11.0.16.tgz#b6550ac2998e9991f24a99563a93475542885ba7"
@@ -5737,6 +5768,11 @@
57375768
dependencies:
57385769
"@opentelemetry/core" "^1.1.0"
57395770

5771+
"@oxc-project/[email protected]":
5772+
version "0.65.0"
5773+
resolved "https://registry.yarnpkg.com/@oxc-project/types/-/types-0.65.0.tgz#ba40064b6ba43fddee44f0d8518e7929a7dffb05"
5774+
integrity sha512-7MpMzyXCcwxrTxJ4L0siy63Ds/LA8LAM4szumTFiynxTJkfrIZEV4PyR4Th0CqFZQ+oNi8WvW3Dr1MLy7o9qPQ==
5775+
57405776
57415777
version "2.5.0"
57425778
resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.0.tgz#e32d3dda6647791ee930556aee206fcd5ea0fb7a"
@@ -6120,6 +6156,68 @@
61206156
dependencies:
61216157
web-streams-polyfill "^3.1.1"
61226158

6159+
"@rolldown/[email protected]":
6160+
version "1.0.0-beta.8"
6161+
resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-beta.8.tgz#9793e0b95360cddaa89efb43417fc2b2e4604008"
6162+
integrity sha512-4cwzBnUvPUVdjUMo9uFkcTvj+Z6IXaN/YJSz1RuI/DG5+vlQ9wYfKeDkvb1nsrhi4ZJ99OInOw1Vh/n2ReX8rA==
6163+
6164+
"@rolldown/[email protected]":
6165+
version "1.0.0-beta.8"
6166+
resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-beta.8.tgz#f67f3345203161b15b9d59a2875ee66f46c2f6aa"
6167+
integrity sha512-BYI7UXc0UqjdpmEyNpxulv8cYbTdL7zLzIr6GDdIvHH7fe/pKTmC9GpvkpF/j2cyP0SUKTd6ExX7nFDNDqKMBw==
6168+
6169+
"@rolldown/[email protected]":
6170+
version "1.0.0-beta.8"
6171+
resolved "https://registry.yarnpkg.com/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-beta.8.tgz#adcabf00d9b28a68c414081927af20e0c4c7af8f"
6172+
integrity sha512-KsX/nuGiuNugIeBelN7M7c/8kzcAW6IfH080z9IrIrlCaGa+xwjqMAf7JuYLZo82uokFq8nql0YpQIazFwFR0Q==
6173+
6174+
"@rolldown/[email protected]":
6175+
version "1.0.0-beta.8"
6176+
resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-beta.8.tgz#75d43988d46a432592034e8516c645565c7ed2b9"
6177+
integrity sha512-IzmoAB9J9iOnoC2Nb6AlyIPPULcbLb0qtJDq21+95u/qiE2GYtI5M4aNudbAIdyv0MU4SAdhkG2sXjMo79H/Zg==
6178+
6179+
"@rolldown/[email protected]":
6180+
version "1.0.0-beta.8"
6181+
resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-beta.8.tgz#c03da3b644045fc0c4de8f399293dad3b3e7b073"
6182+
integrity sha512-nGtOvVKMywOlqoFiMJgILgCpdVcPe0psH1oCWtieMyFFU/v2h2ucjstAEeCOe+JfMVVA7OpdNoWKc54Y1V7gGw==
6183+
6184+
"@rolldown/[email protected]":
6185+
version "1.0.0-beta.8"
6186+
resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-beta.8.tgz#49e7dfe0c31780fc19ba6aebbcbdf4fb435c903b"
6187+
integrity sha512-paTZphpweKHNwlIu0JTAJCddn/psFzNUaKeGEY4vTQEqDcewKp9SsxN7240ao1eqTYy6TMFJiX6Ej2ym93MkSQ==
6188+
6189+
"@rolldown/[email protected]":
6190+
version "1.0.0-beta.8"
6191+
resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-beta.8.tgz#2fcbc7e4242eb3deaaa243d6221aeb98b2d5ecaa"
6192+
integrity sha512-Pdt5iaG/wlWTvEz1lZ3kDkmVXM7DxQXPFZUX/UjDnUyxf4vSgxszbSx1tiNdU0D9v1IISgBapANSwJOGtF1lWw==
6193+
6194+
"@rolldown/[email protected]":
6195+
version "1.0.0-beta.8"
6196+
resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-beta.8.tgz#afa791a210f453a1a9da3f23ab73e5091984f18b"
6197+
integrity sha512-8LoLgKq+Wb030p+tzw0JrOrbJrR2wmqfARX1CHIhge8LBoxd2lfHtWfkg23qRa1S8So/nBZBhrQsg2kXUkpwxw==
6198+
6199+
"@rolldown/[email protected]":
6200+
version "1.0.0-beta.8"
6201+
resolved "https://registry.yarnpkg.com/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-beta.8.tgz#27c1df63b82d8a44f3ca28e4fcad7d93bf927fb0"
6202+
integrity sha512-+2y9Omf9tZRR44Y4EYqm3/Zq2f4Tv+Gh8NsExFWM6WpQZI3HyIB07lrTNQfOJgKSsAiUisnbjiPVTkiH5miy1w==
6203+
dependencies:
6204+
"@napi-rs/wasm-runtime" "^0.2.4"
6205+
6206+
"@rolldown/[email protected]":
6207+
version "1.0.0-beta.8"
6208+
resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-beta.8.tgz#df46882718459c816463d4724b0aa96dd6aa3e0b"
6209+
integrity sha512-bt5AOleb2yp+Br9Yzew+jbSEGjLoqGwknH0xhK8QkhXKx31sJLseaP7nFXr6JaEbmL4DVmAVgrOcyLzLbR6+Mw==
6210+
6211+
"@rolldown/[email protected]":
6212+
version "1.0.0-beta.8"
6213+
resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.0.0-beta.8.tgz#c1b6c6326e8a89c0c5d914330ef911fed02f20bd"
6214+
integrity sha512-Fa1OH6eUWtjBNNkKiSSq1fHVMuiqQ+Bi9uMNJz7gBFgjNiAB9k9rQr0j9eF1k4H6lXFkuoN5P7pXty6aBh93Cw==
6215+
6216+
"@rolldown/[email protected]":
6217+
version "1.0.0-beta.8"
6218+
resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-beta.8.tgz#7003571b44b20a0e83ecb5134e6ec34b3a2fb0ee"
6219+
integrity sha512-hR81d84Poe6oIxaz4PnWBLVF0VuqtRfISIyXQAgk2etu2udrKnWKr3A+xqXe9ELjbLlRYGvEm2dlw/cldO9Kxg==
6220+
61236221
"@rollup/plugin-alias@^5.0.0", "@rollup/plugin-alias@^5.1.0":
61246222
version "5.1.0"
61256223
resolved "https://registry.yarnpkg.com/@rollup/plugin-alias/-/plugin-alias-5.1.0.tgz#99a94accc4ff9a3483be5baeedd5d7da3b597e93"
@@ -7447,6 +7545,13 @@
74477545
"@tufjs/canonical-json" "1.0.0"
74487546
minimatch "^9.0.0"
74497547

7548+
"@tybys/wasm-util@^0.9.0":
7549+
version "0.9.0"
7550+
resolved "https://registry.yarnpkg.com/@tybys/wasm-util/-/wasm-util-0.9.0.tgz#3e75eb00604c8d6db470bf18c37b7d984a0e3355"
7551+
integrity sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==
7552+
dependencies:
7553+
tslib "^2.4.0"
7554+
74507555
"@types/accepts@^1.3.5":
74517556
version "1.3.5"
74527557
resolved "https://registry.yarnpkg.com/@types/accepts/-/accepts-1.3.5.tgz#c34bec115cfc746e04fe5a059df4ce7e7b391575"
@@ -8538,6 +8643,11 @@
85388643
hookable "^5.5.3"
85398644
unhead "1.11.6"
85408645

8646+
"@valibot/[email protected]":
8647+
version "1.0.0"
8648+
resolved "https://registry.yarnpkg.com/@valibot/to-json-schema/-/to-json-schema-1.0.0.tgz#69ce115d3b2c3d924a784f36247aff1949ad4daf"
8649+
integrity sha512-/9crJgPptVsGCL6X+JPDQyaJwkalSZ/52WuF8DiRUxJgcmpNdzYRfZ+gqMEP8W3CTVfuMWPqqvIgfwJ97f9Etw==
8650+
85418651
"@vercel/nft@^0.26.5":
85428652
version "0.26.5"
85438653
resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.26.5.tgz#f21e40576b76446851b6cbff79f39a72dab4d6b2"
@@ -9565,6 +9675,11 @@ ansicolors@~0.2.1:
95659675
resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.2.1.tgz#be089599097b74a5c9c4a84a0cdbcdb62bd87aef"
95669676
integrity sha1-vgiVmQl7dKXJxKhKDNvNtivYeu8=
95679677

9678+
ansis@^3.17.0:
9679+
version "3.17.0"
9680+
resolved "https://registry.yarnpkg.com/ansis/-/ansis-3.17.0.tgz#fa8d9c2a93fe7d1177e0c17f9eeb562a58a832d7"
9681+
integrity sha512-0qWUglt9JEqLFr3w1I1pbrChn1grhaiAR2ocX1PP/flRmxgtwTzPFFFnfIlD6aMOLQZgSuCRlidD70lvx8yhzg==
9682+
95689683
any-promise@^1.0.0, any-promise@^1.1.0:
95699684
version "1.3.0"
95709685
resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
@@ -25446,6 +25561,29 @@ roarr@^7.0.4:
2544625561
safe-stable-stringify "^2.4.1"
2544725562
semver-compare "^1.0.0"
2544825563

25564+
rolldown@^1.0.0-beta.8:
25565+
version "1.0.0-beta.8"
25566+
resolved "https://registry.yarnpkg.com/rolldown/-/rolldown-1.0.0-beta.8.tgz#be4f19988259ea7dda58a1ef8eeddebafb1fcfc8"
25567+
integrity sha512-lwctoQjonOosxGhVbuoIARk8TNO2roqAh/ArhNmT/e/INMN+fzO0++yCypVZLZczOdgTARrYmsOEnTgMOt9sSg==
25568+
dependencies:
25569+
"@oxc-project/types" "0.65.0"
25570+
"@valibot/to-json-schema" "1.0.0"
25571+
ansis "^3.17.0"
25572+
valibot "1.0.0"
25573+
optionalDependencies:
25574+
"@rolldown/binding-darwin-arm64" "1.0.0-beta.8"
25575+
"@rolldown/binding-darwin-x64" "1.0.0-beta.8"
25576+
"@rolldown/binding-freebsd-x64" "1.0.0-beta.8"
25577+
"@rolldown/binding-linux-arm-gnueabihf" "1.0.0-beta.8"
25578+
"@rolldown/binding-linux-arm64-gnu" "1.0.0-beta.8"
25579+
"@rolldown/binding-linux-arm64-musl" "1.0.0-beta.8"
25580+
"@rolldown/binding-linux-x64-gnu" "1.0.0-beta.8"
25581+
"@rolldown/binding-linux-x64-musl" "1.0.0-beta.8"
25582+
"@rolldown/binding-wasm32-wasi" "1.0.0-beta.8"
25583+
"@rolldown/binding-win32-arm64-msvc" "1.0.0-beta.8"
25584+
"@rolldown/binding-win32-ia32-msvc" "1.0.0-beta.8"
25585+
"@rolldown/binding-win32-x64-msvc" "1.0.0-beta.8"
25586+
2544925587
rollup-plugin-cleanup@^3.2.1:
2545025588
version "3.2.1"
2545125589
resolved "https://registry.yarnpkg.com/rollup-plugin-cleanup/-/rollup-plugin-cleanup-3.2.1.tgz#8cbc92ecf58babd7c210051929797f137bbf777c"
@@ -27080,7 +27218,6 @@ [email protected], stylus@^0.59.0:
2708027218

2708127219
sucrase@^3.27.0, sucrase@^3.35.0, sucrase@getsentry/sucrase#es2020-polyfills:
2708227220
version "3.36.0"
27083-
uid fd682f6129e507c00bb4e6319cc5d6b767e36061
2708427221
resolved "https://codeload.github.com/getsentry/sucrase/tar.gz/fd682f6129e507c00bb4e6319cc5d6b767e36061"
2708527222
dependencies:
2708627223
"@jridgewell/gen-mapping" "^0.3.2"
@@ -28743,6 +28880,11 @@ [email protected], v8-compile-cache@^2.0.3, v8-compile-cache@^2.3.0:
2874328880
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"
2874428881
integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==
2874528882

28883+
28884+
version "1.0.0"
28885+
resolved "https://registry.yarnpkg.com/valibot/-/valibot-1.0.0.tgz#1f82514296abcd23d0ae4280088ba85f8651c564"
28886+
integrity sha512-1Hc0ihzWxBar6NGeZv7fPLY0QuxFMyxwYR2sF1Blu7Wq7EnremwY2W02tit2ij2VJT8HcSkHAQqmFfl77f73Yw==
28887+
2874628888
valibot@^0.41.0:
2874728889
version "0.41.0"
2874828890
resolved "https://registry.yarnpkg.com/valibot/-/valibot-0.41.0.tgz#5c2efd49c078e455f7862379365f6036f3cd9f96"

0 commit comments

Comments
 (0)