metro-transform-worker 0.84.4 → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -10
- package/src/index.js +3 -1
- package/src/index.js.flow +3 -1
- package/src/utils/getMinifier.js +2 -1
- package/src/utils/getMinifier.js.flow +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metro-transform-worker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.0",
|
|
4
4
|
"description": "🚇 Transform worker for Metro.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/
|
|
13
|
+
"url": "git+https://github.com/react/metro.git",
|
|
14
14
|
"directory": "packages/metro-transform-worker"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"@babel/parser": "^7.29.0",
|
|
25
25
|
"@babel/types": "^7.29.0",
|
|
26
26
|
"flow-enums-runtime": "^0.0.6",
|
|
27
|
-
"metro": "0.
|
|
28
|
-
"metro-babel-transformer": "0.
|
|
29
|
-
"metro-cache": "0.
|
|
30
|
-
"metro-cache-key": "0.
|
|
31
|
-
"metro-minify-terser": "0.
|
|
32
|
-
"metro-source-map": "0.
|
|
33
|
-
"metro-transform-plugins": "0.
|
|
27
|
+
"metro": "0.85.0",
|
|
28
|
+
"metro-babel-transformer": "0.85.0",
|
|
29
|
+
"metro-cache": "0.85.0",
|
|
30
|
+
"metro-cache-key": "0.85.0",
|
|
31
|
+
"metro-minify-terser": "0.85.0",
|
|
32
|
+
"metro-source-map": "0.85.0",
|
|
33
|
+
"metro-transform-plugins": "0.85.0",
|
|
34
34
|
"nullthrows": "^1.1.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -38,6 +38,6 @@
|
|
|
38
38
|
"metro-memory-fs": "*"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": "^
|
|
41
|
+
"node": "^22.13.0 || ^24.3.0 || >= 26.0.0"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/src/index.js
CHANGED
|
@@ -350,7 +350,9 @@ async function transformAsset(file, context) {
|
|
|
350
350
|
}
|
|
351
351
|
async function transformJSWithBabel(file, context) {
|
|
352
352
|
const { babelTransformerPath } = context.config;
|
|
353
|
-
const
|
|
353
|
+
const mod = require(babelTransformerPath);
|
|
354
|
+
const transformer =
|
|
355
|
+
mod.__esModule === true && "default" in mod ? mod.default : mod;
|
|
354
356
|
const transformResult = await transformer.transform(
|
|
355
357
|
getBabelTransformArgs(file, context, [
|
|
356
358
|
_metroSourceMap.functionMapBabelPlugin,
|
package/src/index.js.flow
CHANGED
|
@@ -542,7 +542,9 @@ async function transformJSWithBabel(
|
|
|
542
542
|
): Promise<TransformResponse> {
|
|
543
543
|
const {babelTransformerPath} = context.config;
|
|
544
544
|
// $FlowFixMe[unsupported-syntax] dynamic require
|
|
545
|
-
const
|
|
545
|
+
const mod = require(babelTransformerPath);
|
|
546
|
+
const transformer: BabelTransformer =
|
|
547
|
+
mod.__esModule === true && 'default' in mod ? mod.default : mod;
|
|
546
548
|
|
|
547
549
|
const transformResult = await transformer.transform(
|
|
548
550
|
getBabelTransformArgs(file, context, [
|
package/src/utils/getMinifier.js
CHANGED
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = getMinifier;
|
|
7
7
|
function getMinifier(minifierPath) {
|
|
8
8
|
try {
|
|
9
|
-
|
|
9
|
+
const mod = require(minifierPath);
|
|
10
|
+
return mod.__esModule === true && "default" in mod ? mod.default : mod;
|
|
10
11
|
} catch (e) {
|
|
11
12
|
throw new Error(
|
|
12
13
|
'A problem occurred while trying to fetch the minifier. Path: "' +
|
|
@@ -17,7 +17,8 @@ export default function getMinifier(minifierPath: string): Minifier {
|
|
|
17
17
|
// any entry point that accepts them...
|
|
18
18
|
try {
|
|
19
19
|
// $FlowFixMe[unsupported-syntax] TODO t0 cannot do require with literal
|
|
20
|
-
|
|
20
|
+
const mod = require(minifierPath);
|
|
21
|
+
return mod.__esModule === true && 'default' in mod ? mod.default : mod;
|
|
21
22
|
} catch (e) {
|
|
22
23
|
throw new Error(
|
|
23
24
|
'A problem occurred while trying to fetch the minifier. Path: "' +
|