Skip to content

Commit 5e6071b

Browse files
authored
fix(metro-plugin-esbuild): bump minimum Node version (#3899)
1 parent 579bad7 commit 5e6071b

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

.changeset/loud-parks-watch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@rnx-kit/metro-serializer-esbuild": minor
3+
---
4+
5+
Bumped minimum Node version to 22

packages/metro-serializer-esbuild/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
"@rnx-kit/tools-node": "^3.0.3",
3939
"@rnx-kit/tools-react-native": "^2.3.2",
4040
"esbuild": "^0.27.1",
41-
"esbuild-plugin-lodash": "^1.2.0",
42-
"fast-glob": "^3.2.7"
41+
"esbuild-plugin-lodash": "^1.2.0"
4342
},
4443
"devDependencies": {
4544
"@babel/core": "^7.20.0",
@@ -65,6 +64,6 @@
6564
"react-native": "^0.81.0"
6665
},
6766
"engines": {
68-
"node": ">=16.17"
67+
"node": ">=22.11"
6968
}
7069
}

packages/metro-serializer-esbuild/src/module.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { warn } from "@rnx-kit/console";
22
import { findPackage, readPackage } from "@rnx-kit/tools-node/package";
33
import type { BuildOptions } from "esbuild";
44
import type { Module, ReadOnlyDependencies } from "metro";
5+
import * as fs from "node:fs";
56
import * as path from "node:path";
67
import { generateSourceMappingURL } from "./sourceMap.ts";
78

@@ -41,13 +42,10 @@ export const getSideEffects = (() => {
4142
if (!(pkgJson in pkgCache)) {
4243
const { sideEffects } = readPackage(pkgJson);
4344
if (Array.isArray(sideEffects)) {
44-
const fg = require("fast-glob");
45-
pkgCache[pkgJson] = fg
46-
.sync(sideEffects, {
47-
cwd: path.dirname(pkgJson),
48-
absolute: true,
49-
})
50-
.map((p: string) => p.replace(/[/\\]/g, path.sep));
45+
const cwd = path.dirname(pkgJson);
46+
pkgCache[pkgJson] = fs
47+
.globSync(sideEffects, { cwd })
48+
.map((p: string) => path.join(cwd, p.replace(/[/\\]/g, path.sep)));
5149
} else if (typeof sideEffects === "boolean") {
5250
pkgCache[pkgJson] = sideEffects;
5351
} else {

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5034,7 +5034,6 @@ __metadata:
50345034
"@types/node": "npm:^24.0.0"
50355035
esbuild: "npm:^0.27.1"
50365036
esbuild-plugin-lodash: "npm:^1.2.0"
5037-
fast-glob: "npm:^3.2.7"
50385037
lodash-es: "npm:^4.17.21"
50395038
metro: "npm:^0.83.1"
50405039
metro-config: "npm:^0.83.1"

0 commit comments

Comments
 (0)