@vxrn/react-native-prebuilt 1.1.221 → 1.1.226
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/dist/cjs/index.native.js +151 -425
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/esm/index.native.js +150 -423
- package/dist/esm/index.native.js.map +2 -2
- package/dist/esm/index.native.mjs +176 -0
- package/dist/esm/index.native.mjs.map +1 -0
- package/package.json +5 -6
package/dist/esm/index.native.js
CHANGED
|
@@ -4,433 +4,171 @@ import { build } from "esbuild";
|
|
|
4
4
|
import FSExtra from "fs-extra";
|
|
5
5
|
import { resolve as importMetaResolve } from "import-meta-resolve";
|
|
6
6
|
import process from "node:process";
|
|
7
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8
|
-
try {
|
|
9
|
-
var info = gen[key](arg), value = info.value;
|
|
10
|
-
} catch (error) {
|
|
11
|
-
reject(error);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw);
|
|
15
|
-
}
|
|
16
|
-
function _async_to_generator(fn) {
|
|
17
|
-
return function() {
|
|
18
|
-
var self = this, args = arguments;
|
|
19
|
-
return new Promise(function(resolve, reject) {
|
|
20
|
-
var gen = fn.apply(self, args);
|
|
21
|
-
function _next(value) {
|
|
22
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
23
|
-
}
|
|
24
|
-
function _throw(err) {
|
|
25
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
26
|
-
}
|
|
27
|
-
_next(void 0);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function _define_property(obj, key, value) {
|
|
32
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
33
|
-
value,
|
|
34
|
-
enumerable: !0,
|
|
35
|
-
configurable: !0,
|
|
36
|
-
writable: !0
|
|
37
|
-
}) : obj[key] = value, obj;
|
|
38
|
-
}
|
|
39
|
-
function _object_spread(target) {
|
|
40
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
41
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
42
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
43
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
44
|
-
}))), ownKeys2.forEach(function(key) {
|
|
45
|
-
_define_property(target, key, source[key]);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return target;
|
|
49
|
-
}
|
|
50
|
-
function ownKeys(object, enumerableOnly) {
|
|
51
|
-
var keys = Object.keys(object);
|
|
52
|
-
if (Object.getOwnPropertySymbols) {
|
|
53
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
54
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
55
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
56
|
-
})), keys.push.apply(keys, symbols);
|
|
57
|
-
}
|
|
58
|
-
return keys;
|
|
59
|
-
}
|
|
60
|
-
function _object_spread_props(target, source) {
|
|
61
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
62
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
63
|
-
}), target;
|
|
64
|
-
}
|
|
65
|
-
function _ts_generator(thisArg, body) {
|
|
66
|
-
var f, y, t, g, _ = {
|
|
67
|
-
label: 0,
|
|
68
|
-
sent: function() {
|
|
69
|
-
if (t[0] & 1) throw t[1];
|
|
70
|
-
return t[1];
|
|
71
|
-
},
|
|
72
|
-
trys: [],
|
|
73
|
-
ops: []
|
|
74
|
-
};
|
|
75
|
-
return g = {
|
|
76
|
-
next: verb(0),
|
|
77
|
-
throw: verb(1),
|
|
78
|
-
return: verb(2)
|
|
79
|
-
}, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
|
|
80
|
-
return this;
|
|
81
|
-
}), g;
|
|
82
|
-
function verb(n) {
|
|
83
|
-
return function(v) {
|
|
84
|
-
return step([
|
|
85
|
-
n,
|
|
86
|
-
v
|
|
87
|
-
]);
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
function step(op) {
|
|
91
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
92
|
-
for (; _; ) try {
|
|
93
|
-
if (f = 1, y && (t = op[0] & 2 ? y.return : op[0] ? y.throw || ((t = y.return) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
94
|
-
switch (y = 0, t && (op = [
|
|
95
|
-
op[0] & 2,
|
|
96
|
-
t.value
|
|
97
|
-
]), op[0]) {
|
|
98
|
-
case 0:
|
|
99
|
-
case 1:
|
|
100
|
-
t = op;
|
|
101
|
-
break;
|
|
102
|
-
case 4:
|
|
103
|
-
return _.label++, {
|
|
104
|
-
value: op[1],
|
|
105
|
-
done: !1
|
|
106
|
-
};
|
|
107
|
-
case 5:
|
|
108
|
-
_.label++, y = op[1], op = [
|
|
109
|
-
0
|
|
110
|
-
];
|
|
111
|
-
continue;
|
|
112
|
-
case 7:
|
|
113
|
-
op = _.ops.pop(), _.trys.pop();
|
|
114
|
-
continue;
|
|
115
|
-
default:
|
|
116
|
-
if (t = _.trys, !(t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
117
|
-
_ = 0;
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
121
|
-
_.label = op[1];
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
125
|
-
_.label = t[1], t = op;
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
if (t && _.label < t[2]) {
|
|
129
|
-
_.label = t[2], _.ops.push(op);
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
t[2] && _.ops.pop(), _.trys.pop();
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
op = body.call(thisArg, _);
|
|
136
|
-
} catch (e) {
|
|
137
|
-
op = [
|
|
138
|
-
6,
|
|
139
|
-
e
|
|
140
|
-
], y = 0;
|
|
141
|
-
} finally {
|
|
142
|
-
f = t = 0;
|
|
143
|
-
}
|
|
144
|
-
if (op[0] & 5) throw op[1];
|
|
145
|
-
return {
|
|
146
|
-
value: op[0] ? op[1] : void 0,
|
|
147
|
-
done: !0
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
7
|
var external = [
|
|
152
8
|
"react",
|
|
153
9
|
"react/jsx-runtime",
|
|
154
10
|
"react/jsx-dev-runtime"
|
|
155
11
|
];
|
|
156
|
-
function buildAll() {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
case 0:
|
|
164
|
-
return console.info("Prebuilding React Native (one time cost...)"), [
|
|
165
|
-
4,
|
|
166
|
-
Promise.all([
|
|
167
|
-
//
|
|
168
|
-
buildReactJSX(),
|
|
169
|
-
buildReact(),
|
|
170
|
-
buildReactNative()
|
|
171
|
-
])
|
|
172
|
-
];
|
|
173
|
-
case 1:
|
|
174
|
-
return _state.sent(), [
|
|
175
|
-
2
|
|
176
|
-
];
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
}), _buildAll.apply(this, arguments);
|
|
12
|
+
async function buildAll() {
|
|
13
|
+
console.info("Prebuilding React Native (one time cost...)"), await Promise.all([
|
|
14
|
+
//
|
|
15
|
+
buildReactJSX(),
|
|
16
|
+
buildReact(),
|
|
17
|
+
buildReactNative()
|
|
18
|
+
]);
|
|
180
19
|
}
|
|
181
20
|
var resolveFile = function(path) {
|
|
182
21
|
try {
|
|
183
|
-
return importMetaResolve(path,
|
|
22
|
+
return importMetaResolve(path, `file://${process.cwd()}`).replace("file://", "");
|
|
184
23
|
} catch {
|
|
185
24
|
return require.resolve(path);
|
|
186
25
|
}
|
|
187
26
|
};
|
|
188
|
-
function buildReactJSX() {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"process.env.NODE_ENV": '"development"'
|
|
211
|
-
},
|
|
212
|
-
external,
|
|
213
|
-
logLevel: "warning"
|
|
214
|
-
}, options)).then(/* @__PURE__ */ _async_to_generator(function() {
|
|
215
|
-
var bundled, outCode;
|
|
216
|
-
return _ts_generator(this, function(_state2) {
|
|
217
|
-
switch (_state2.label) {
|
|
218
|
-
case 0:
|
|
219
|
-
return [
|
|
220
|
-
4,
|
|
221
|
-
readFile(options.outfile, "utf-8")
|
|
222
|
-
];
|
|
223
|
-
case 1:
|
|
224
|
-
return bundled = _state2.sent(), outCode = `
|
|
27
|
+
async function buildReactJSX() {
|
|
28
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
29
|
+
return build({
|
|
30
|
+
bundle: !0,
|
|
31
|
+
entryPoints: [
|
|
32
|
+
resolveFile("react/jsx-dev-runtime")
|
|
33
|
+
],
|
|
34
|
+
format: "cjs",
|
|
35
|
+
target: "node16",
|
|
36
|
+
jsx: "transform",
|
|
37
|
+
jsxFactory: "react",
|
|
38
|
+
allowOverwrite: !0,
|
|
39
|
+
platform: "node",
|
|
40
|
+
define: {
|
|
41
|
+
__DEV__: "true",
|
|
42
|
+
"process.env.NODE_ENV": '"development"'
|
|
43
|
+
},
|
|
44
|
+
external,
|
|
45
|
+
logLevel: "warning",
|
|
46
|
+
...options
|
|
47
|
+
}).then(async function() {
|
|
48
|
+
var bundled = await readFile(options.outfile, "utf-8"), outCode = `
|
|
225
49
|
const run = () => {
|
|
226
|
-
|
|
50
|
+
${bundled.replace("module.exports = require_react_jsx_dev_runtime_development();", "return require_react_jsx_dev_runtime_development();")}
|
|
227
51
|
}
|
|
228
52
|
const __mod__ = run()
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
`)
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
];
|
|
244
|
-
case 2:
|
|
245
|
-
return _state2.sent(), [
|
|
246
|
-
2
|
|
247
|
-
];
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
}))
|
|
251
|
-
];
|
|
252
|
-
});
|
|
253
|
-
}), _buildReactJSX.apply(this, arguments);
|
|
254
|
-
}
|
|
255
|
-
function buildReact() {
|
|
256
|
-
return _buildReact.apply(this, arguments);
|
|
53
|
+
${[
|
|
54
|
+
"jsx",
|
|
55
|
+
"jsxs",
|
|
56
|
+
"jsxDEV",
|
|
57
|
+
"Fragment"
|
|
58
|
+
].map(function(n) {
|
|
59
|
+
return `export const ${n} = __mod__.${n} || __mod__.jsx || ${/* @__PURE__ */ function() {
|
|
60
|
+
return n === "jsxs" ? "function (type, props, key) { return __mod__.jsxDEV(type, props, key, true) }" : "__mod__.jsxDEV";
|
|
61
|
+
}()}`;
|
|
62
|
+
}).join(`
|
|
63
|
+
`)}
|
|
64
|
+
`;
|
|
65
|
+
await FSExtra.writeFile(options.outfile, outCode);
|
|
66
|
+
});
|
|
257
67
|
}
|
|
258
|
-
function
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
external
|
|
281
|
-
}, options)).then(/* @__PURE__ */ _async_to_generator(function() {
|
|
282
|
-
var bundled, outCode;
|
|
283
|
-
return _ts_generator(this, function(_state2) {
|
|
284
|
-
switch (_state2.label) {
|
|
285
|
-
case 0:
|
|
286
|
-
return [
|
|
287
|
-
4,
|
|
288
|
-
readFile(options.outfile, "utf-8")
|
|
289
|
-
];
|
|
290
|
-
case 1:
|
|
291
|
-
return bundled = _state2.sent(), outCode = `
|
|
68
|
+
async function buildReact() {
|
|
69
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
70
|
+
return build({
|
|
71
|
+
bundle: !0,
|
|
72
|
+
entryPoints: [
|
|
73
|
+
resolveFile("react")
|
|
74
|
+
],
|
|
75
|
+
format: "cjs",
|
|
76
|
+
target: "node16",
|
|
77
|
+
jsx: "transform",
|
|
78
|
+
jsxFactory: "react",
|
|
79
|
+
allowOverwrite: !0,
|
|
80
|
+
platform: "node",
|
|
81
|
+
define: {
|
|
82
|
+
__DEV__: "true",
|
|
83
|
+
"process.env.NODE_ENV": '"development"'
|
|
84
|
+
},
|
|
85
|
+
logLevel: "warning",
|
|
86
|
+
external,
|
|
87
|
+
...options
|
|
88
|
+
}).then(async function() {
|
|
89
|
+
var bundled = await readFile(options.outfile, "utf-8"), outCode = `
|
|
292
90
|
const run = () => {
|
|
293
|
-
|
|
91
|
+
${bundled.replace("module.exports = require_react_development();", "return require_react_development();")}
|
|
294
92
|
}
|
|
295
93
|
const __mod__ = run()
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
`)
|
|
94
|
+
${RExports.map(function(n) {
|
|
95
|
+
return `export const ${n} = __mod__.${n}`;
|
|
96
|
+
}).join(`
|
|
97
|
+
`)}
|
|
300
98
|
export default __mod__
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
];
|
|
305
|
-
case 2:
|
|
306
|
-
return _state2.sent(), [
|
|
307
|
-
2
|
|
308
|
-
];
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
}))
|
|
312
|
-
];
|
|
313
|
-
});
|
|
314
|
-
}), _buildReact.apply(this, arguments);
|
|
315
|
-
}
|
|
316
|
-
function buildReactNative() {
|
|
317
|
-
return _buildReactNative.apply(this, arguments);
|
|
99
|
+
`;
|
|
100
|
+
await FSExtra.writeFile(options.outfile, outCode);
|
|
101
|
+
});
|
|
318
102
|
}
|
|
319
|
-
function
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
return function(input) {
|
|
380
|
-
return _ref.apply(this, arguments);
|
|
381
|
-
};
|
|
382
|
-
}()), build2.onLoad({
|
|
383
|
-
filter: /.*.js/
|
|
384
|
-
}, function() {
|
|
385
|
-
var _ref = _async_to_generator(function(input) {
|
|
386
|
-
var code, outagain;
|
|
387
|
-
return _ts_generator(this, function(_state2) {
|
|
388
|
-
switch (_state2.label) {
|
|
389
|
-
case 0:
|
|
390
|
-
return !input.path.includes("react-native") && !input.path.includes("vite-native-hmr") ? [
|
|
391
|
-
2
|
|
392
|
-
] : [
|
|
393
|
-
4,
|
|
394
|
-
readFile(input.path, "utf-8")
|
|
395
|
-
];
|
|
396
|
-
case 1:
|
|
397
|
-
return code = _state2.sent(), [
|
|
398
|
-
4,
|
|
399
|
-
transformFlow(code, {
|
|
400
|
-
development: !0
|
|
401
|
-
})
|
|
402
|
-
];
|
|
403
|
-
case 2:
|
|
404
|
-
return outagain = _state2.sent(), [
|
|
405
|
-
2,
|
|
406
|
-
{
|
|
407
|
-
contents: outagain,
|
|
408
|
-
loader: "jsx"
|
|
409
|
-
}
|
|
410
|
-
];
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
|
-
});
|
|
414
|
-
return function(input) {
|
|
415
|
-
return _ref.apply(this, arguments);
|
|
416
|
-
};
|
|
417
|
-
}());
|
|
418
|
-
}
|
|
103
|
+
async function buildReactNative() {
|
|
104
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
105
|
+
return build({
|
|
106
|
+
bundle: !0,
|
|
107
|
+
entryPoints: [
|
|
108
|
+
resolveFile("react-native")
|
|
109
|
+
],
|
|
110
|
+
format: "cjs",
|
|
111
|
+
target: "node20",
|
|
112
|
+
// Note: JSX is actually being transformed by the "remove-flow" plugin defined underneath, not by esbuild. The following JSX options may not actually make a difference.
|
|
113
|
+
jsx: "transform",
|
|
114
|
+
jsxFactory: "react",
|
|
115
|
+
allowOverwrite: !0,
|
|
116
|
+
platform: "node",
|
|
117
|
+
external,
|
|
118
|
+
loader: {
|
|
119
|
+
".png": "dataurl",
|
|
120
|
+
".jpg": "dataurl",
|
|
121
|
+
".jpeg": "dataurl",
|
|
122
|
+
".gif": "dataurl"
|
|
123
|
+
},
|
|
124
|
+
define: {
|
|
125
|
+
__DEV__: "true",
|
|
126
|
+
"process.env.NODE_ENV": '"development"'
|
|
127
|
+
},
|
|
128
|
+
logLevel: "warning",
|
|
129
|
+
resolveExtensions: [
|
|
130
|
+
".ios.js",
|
|
131
|
+
".native.js",
|
|
132
|
+
".native.ts",
|
|
133
|
+
".native.tsx",
|
|
134
|
+
".js",
|
|
135
|
+
".jsx",
|
|
136
|
+
".json",
|
|
137
|
+
".ts",
|
|
138
|
+
".tsx",
|
|
139
|
+
".mjs"
|
|
140
|
+
],
|
|
141
|
+
...options,
|
|
142
|
+
plugins: [
|
|
143
|
+
{
|
|
144
|
+
name: "remove-flow",
|
|
145
|
+
setup(build2) {
|
|
146
|
+
build2.onResolve({
|
|
147
|
+
filter: /HMRClient/
|
|
148
|
+
}, async function(input) {
|
|
149
|
+
return {
|
|
150
|
+
path: resolveFile("@vxrn/vite-native-hmr")
|
|
151
|
+
};
|
|
152
|
+
}), build2.onLoad({
|
|
153
|
+
filter: /.*.js/
|
|
154
|
+
}, async function(input) {
|
|
155
|
+
if (!(!input.path.includes("react-native") && !input.path.includes("vite-native-hmr"))) {
|
|
156
|
+
var code = await readFile(input.path, "utf-8"), outagain = await transformFlow(code, {
|
|
157
|
+
development: !0
|
|
158
|
+
});
|
|
159
|
+
return {
|
|
160
|
+
contents: outagain,
|
|
161
|
+
loader: "jsx"
|
|
162
|
+
};
|
|
419
163
|
}
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
return [
|
|
427
|
-
4,
|
|
428
|
-
readFile(options.outfile, "utf-8")
|
|
429
|
-
];
|
|
430
|
-
case 1:
|
|
431
|
-
return bundled = _state2.sent(), outCode = `
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}).then(async function() {
|
|
169
|
+
var bundled = await readFile(options.outfile, "utf-8"), outCode = `
|
|
432
170
|
const run = () => {
|
|
433
|
-
|
|
171
|
+
${bundled.replace(esbuildCommonJSFunction, `
|
|
434
172
|
// replaced commonjs function to allow importing internals
|
|
435
173
|
var __commonJS = (cb, mod) => function __require() {
|
|
436
174
|
if (mod) return mod
|
|
@@ -445,27 +183,16 @@ globalThis['__cachedModules'][path.replace(/.*node_modules\\//, '').replace('.js
|
|
|
445
183
|
|
|
446
184
|
return mod
|
|
447
185
|
};
|
|
448
|
-
`).replace("module.exports = require_react_native();", "return require_react_native();")
|
|
186
|
+
`).replace("module.exports = require_react_native();", "return require_react_native();")}
|
|
449
187
|
}
|
|
450
188
|
const RN = run()
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
`)
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
];
|
|
459
|
-
case 2:
|
|
460
|
-
return _state2.sent(), [
|
|
461
|
-
2
|
|
462
|
-
];
|
|
463
|
-
}
|
|
464
|
-
});
|
|
465
|
-
}))
|
|
466
|
-
];
|
|
467
|
-
});
|
|
468
|
-
}), _buildReactNative.apply(this, arguments);
|
|
189
|
+
${RNExportNames.map(function(n) {
|
|
190
|
+
return `export const ${n} = RN.${n}`;
|
|
191
|
+
}).join(`
|
|
192
|
+
`)}
|
|
193
|
+
`;
|
|
194
|
+
await FSExtra.writeFile(options.outfile, outCode);
|
|
195
|
+
});
|
|
469
196
|
}
|
|
470
197
|
var esbuildCommonJSFunction = `var __commonJS = (cb, mod) => function __require() {
|
|
471
198
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/vxrn/packages/react-native-prebuilt/src/index.ts"],
|
|
4
|
-
"mappings": "AAAA,SAASA,gBAAgB;AAEzB,SAASC,qBAAqB;AAC9B,SAASC,aAAgC;AACzC,OAAOC,aAAa;AACpB,SAASC,WAAWC,yBAAyB;AAC7C,OAAOC,aAAa
|
|
5
|
-
"names": ["readFile", "transformFlow", "build", "FSExtra", "resolve", "importMetaResolve", "process", "external", "buildAll", "console", "info", "Promise", "all", "buildReactJSX", "buildReact", "buildReactNative", "resolveFile", "path", "cwd", "replace", "require", "options", "bundle", "entryPoints", "format", "target", "jsx", "jsxFactory", "allowOverwrite", "platform", "define", "__DEV__", "logLevel", "then", "bundled", "
|
|
4
|
+
"mappings": "AAAA,SAASA,gBAAgB;AAEzB,SAASC,qBAAqB;AAC9B,SAASC,aAAgC;AACzC,OAAOC,aAAa;AACpB,SAASC,WAAWC,yBAAyB;AAC7C,OAAOC,aAAa;AAEpB,IAAMC,WAAW;EAAC;EAAS;EAAqB;;AAEhD,eAAsBC,WAAAA;AACpBC,UAAQC,KAAK,6CAA6C,GAC1D,MAAMC,QAAQC,IAAI;;IAEhBC,cAAAA;IACAC,WAAAA;IACAC,iBAAAA;GACD;AACH;AAEA,IAAMC,cAAc,SAACC,MAAAA;AACnB,MAAI;AACF,WAAOZ,kBAAkBY,MAAM,UAAUX,QAAQY,IAAG,CAAA,EAAI,EAAEC,QAAQ,WAAW,EAAA;EAC/E,QAAc;AACZ,WAAOC,QAAQhB,QAAQa,IAAAA;EACzB;AACF;AAEA,eAAsBJ,gBAAAA;MAAcQ,UAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAwB,CAAC;AAC3D,SAAOnB,MAAM;IACXoB,QAAQ;IACRC,aAAa;MAACP,YAAY,uBAAA;;IAC1BQ,QAAQ;IACRC,QAAQ;IACRC,KAAK;IACLC,YAAY;IACZC,gBAAgB;IAChBC,UAAU;IACVC,QAAQ;MACNC,SAAS;MACT,wBAAwB;IAC1B;IACAxB;IACAyB,UAAU;IACV,GAAGX;EACL,CAAA,EAAGY,KAAK,iBAAA;AAEN,QAAMC,UAAU,MA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EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GAGIhB,WAAW;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;",
|
|
5
|
+
"names": ["readFile", "transformFlow", "build", "FSExtra", "resolve", "importMetaResolve", "process", "external", "buildAll", "console", "info", "Promise", "all", "buildReactJSX", "buildReact", "buildReactNative", "resolveFile", "path", "cwd", "replace", "require", "options", "bundle", "entryPoints", "format", "target", "jsx", "jsxFactory", "allowOverwrite", "platform", "define", "__DEV__", "logLevel", "then", "bundled", "outfile", "outCode", "map", "n", "join", "writeFile", "RExports", "loader", "resolveExtensions", "plugins", "name", "setup", "onResolve", "filter", "input", "onLoad", "includes", "code", "outagain", "development", "contents", "esbuildCommonJSFunction", "RNExportNames"]
|
|
6
6
|
}
|