@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/cjs/index.native.js
CHANGED
|
@@ -29,434 +29,171 @@ __export(src_exports, {
|
|
|
29
29
|
buildReactNative: () => buildReactNative
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(src_exports);
|
|
32
|
-
var import_promises = require("node:fs/promises"), import_vite_flow = require("@vxrn/vite-flow"), import_esbuild = require("esbuild"), import_fs_extra = __toESM(require("fs-extra"), 1), import_import_meta_resolve = require("import-meta-resolve"), import_node_process = __toESM(require("node:process"), 1)
|
|
33
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
34
|
-
try {
|
|
35
|
-
var info = gen[key](arg), value = info.value;
|
|
36
|
-
} catch (error) {
|
|
37
|
-
reject(error);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw);
|
|
41
|
-
}
|
|
42
|
-
function _async_to_generator(fn) {
|
|
43
|
-
return function() {
|
|
44
|
-
var self = this, args = arguments;
|
|
45
|
-
return new Promise(function(resolve, reject) {
|
|
46
|
-
var gen = fn.apply(self, args);
|
|
47
|
-
function _next(value) {
|
|
48
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
49
|
-
}
|
|
50
|
-
function _throw(err) {
|
|
51
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
52
|
-
}
|
|
53
|
-
_next(void 0);
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function _define_property(obj, key, value) {
|
|
58
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
59
|
-
value,
|
|
60
|
-
enumerable: !0,
|
|
61
|
-
configurable: !0,
|
|
62
|
-
writable: !0
|
|
63
|
-
}) : obj[key] = value, obj;
|
|
64
|
-
}
|
|
65
|
-
function _object_spread(target) {
|
|
66
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
67
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
68
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
69
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
70
|
-
}))), ownKeys2.forEach(function(key) {
|
|
71
|
-
_define_property(target, key, source[key]);
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
return target;
|
|
75
|
-
}
|
|
76
|
-
function ownKeys(object, enumerableOnly) {
|
|
77
|
-
var keys = Object.keys(object);
|
|
78
|
-
if (Object.getOwnPropertySymbols) {
|
|
79
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
80
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
81
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
82
|
-
})), keys.push.apply(keys, symbols);
|
|
83
|
-
}
|
|
84
|
-
return keys;
|
|
85
|
-
}
|
|
86
|
-
function _object_spread_props(target, source) {
|
|
87
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
88
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
89
|
-
}), target;
|
|
90
|
-
}
|
|
91
|
-
function _ts_generator(thisArg, body) {
|
|
92
|
-
var f, y, t, g, _ = {
|
|
93
|
-
label: 0,
|
|
94
|
-
sent: function() {
|
|
95
|
-
if (t[0] & 1) throw t[1];
|
|
96
|
-
return t[1];
|
|
97
|
-
},
|
|
98
|
-
trys: [],
|
|
99
|
-
ops: []
|
|
100
|
-
};
|
|
101
|
-
return g = {
|
|
102
|
-
next: verb(0),
|
|
103
|
-
throw: verb(1),
|
|
104
|
-
return: verb(2)
|
|
105
|
-
}, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
|
|
106
|
-
return this;
|
|
107
|
-
}), g;
|
|
108
|
-
function verb(n) {
|
|
109
|
-
return function(v) {
|
|
110
|
-
return step([
|
|
111
|
-
n,
|
|
112
|
-
v
|
|
113
|
-
]);
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
function step(op) {
|
|
117
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
118
|
-
for (; _; ) try {
|
|
119
|
-
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;
|
|
120
|
-
switch (y = 0, t && (op = [
|
|
121
|
-
op[0] & 2,
|
|
122
|
-
t.value
|
|
123
|
-
]), op[0]) {
|
|
124
|
-
case 0:
|
|
125
|
-
case 1:
|
|
126
|
-
t = op;
|
|
127
|
-
break;
|
|
128
|
-
case 4:
|
|
129
|
-
return _.label++, {
|
|
130
|
-
value: op[1],
|
|
131
|
-
done: !1
|
|
132
|
-
};
|
|
133
|
-
case 5:
|
|
134
|
-
_.label++, y = op[1], op = [
|
|
135
|
-
0
|
|
136
|
-
];
|
|
137
|
-
continue;
|
|
138
|
-
case 7:
|
|
139
|
-
op = _.ops.pop(), _.trys.pop();
|
|
140
|
-
continue;
|
|
141
|
-
default:
|
|
142
|
-
if (t = _.trys, !(t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
143
|
-
_ = 0;
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
147
|
-
_.label = op[1];
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
151
|
-
_.label = t[1], t = op;
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
if (t && _.label < t[2]) {
|
|
155
|
-
_.label = t[2], _.ops.push(op);
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
t[2] && _.ops.pop(), _.trys.pop();
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
op = body.call(thisArg, _);
|
|
162
|
-
} catch (e) {
|
|
163
|
-
op = [
|
|
164
|
-
6,
|
|
165
|
-
e
|
|
166
|
-
], y = 0;
|
|
167
|
-
} finally {
|
|
168
|
-
f = t = 0;
|
|
169
|
-
}
|
|
170
|
-
if (op[0] & 5) throw op[1];
|
|
171
|
-
return {
|
|
172
|
-
value: op[0] ? op[1] : void 0,
|
|
173
|
-
done: !0
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
var external = [
|
|
32
|
+
var import_promises = require("node:fs/promises"), import_vite_flow = require("@vxrn/vite-flow"), import_esbuild = require("esbuild"), import_fs_extra = __toESM(require("fs-extra"), 1), import_import_meta_resolve = require("import-meta-resolve"), import_node_process = __toESM(require("node:process"), 1), external = [
|
|
178
33
|
"react",
|
|
179
34
|
"react/jsx-runtime",
|
|
180
35
|
"react/jsx-dev-runtime"
|
|
181
36
|
];
|
|
182
|
-
function buildAll() {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
case 0:
|
|
190
|
-
return console.info("Prebuilding React Native (one time cost...)"), [
|
|
191
|
-
4,
|
|
192
|
-
Promise.all([
|
|
193
|
-
//
|
|
194
|
-
buildReactJSX(),
|
|
195
|
-
buildReact(),
|
|
196
|
-
buildReactNative()
|
|
197
|
-
])
|
|
198
|
-
];
|
|
199
|
-
case 1:
|
|
200
|
-
return _state.sent(), [
|
|
201
|
-
2
|
|
202
|
-
];
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}), _buildAll.apply(this, arguments);
|
|
37
|
+
async function buildAll() {
|
|
38
|
+
console.info("Prebuilding React Native (one time cost...)"), await Promise.all([
|
|
39
|
+
//
|
|
40
|
+
buildReactJSX(),
|
|
41
|
+
buildReact(),
|
|
42
|
+
buildReactNative()
|
|
43
|
+
]);
|
|
206
44
|
}
|
|
207
45
|
var resolveFile = function(path) {
|
|
208
46
|
try {
|
|
209
|
-
return (0, import_import_meta_resolve.resolve)(path,
|
|
47
|
+
return (0, import_import_meta_resolve.resolve)(path, `file://${import_node_process.default.cwd()}`).replace("file://", "");
|
|
210
48
|
} catch {
|
|
211
49
|
return require.resolve(path);
|
|
212
50
|
}
|
|
213
51
|
};
|
|
214
|
-
function buildReactJSX() {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
"process.env.NODE_ENV": '"development"'
|
|
237
|
-
},
|
|
238
|
-
external,
|
|
239
|
-
logLevel: "warning"
|
|
240
|
-
}, options)).then(/* @__PURE__ */ _async_to_generator(function() {
|
|
241
|
-
var bundled, outCode;
|
|
242
|
-
return _ts_generator(this, function(_state2) {
|
|
243
|
-
switch (_state2.label) {
|
|
244
|
-
case 0:
|
|
245
|
-
return [
|
|
246
|
-
4,
|
|
247
|
-
(0, import_promises.readFile)(options.outfile, "utf-8")
|
|
248
|
-
];
|
|
249
|
-
case 1:
|
|
250
|
-
return bundled = _state2.sent(), outCode = `
|
|
52
|
+
async function buildReactJSX() {
|
|
53
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
54
|
+
return (0, import_esbuild.build)({
|
|
55
|
+
bundle: !0,
|
|
56
|
+
entryPoints: [
|
|
57
|
+
resolveFile("react/jsx-dev-runtime")
|
|
58
|
+
],
|
|
59
|
+
format: "cjs",
|
|
60
|
+
target: "node16",
|
|
61
|
+
jsx: "transform",
|
|
62
|
+
jsxFactory: "react",
|
|
63
|
+
allowOverwrite: !0,
|
|
64
|
+
platform: "node",
|
|
65
|
+
define: {
|
|
66
|
+
__DEV__: "true",
|
|
67
|
+
"process.env.NODE_ENV": '"development"'
|
|
68
|
+
},
|
|
69
|
+
external,
|
|
70
|
+
logLevel: "warning",
|
|
71
|
+
...options
|
|
72
|
+
}).then(async function() {
|
|
73
|
+
var bundled = await (0, import_promises.readFile)(options.outfile, "utf-8"), outCode = `
|
|
251
74
|
const run = () => {
|
|
252
|
-
|
|
75
|
+
${bundled.replace("module.exports = require_react_jsx_dev_runtime_development();", "return require_react_jsx_dev_runtime_development();")}
|
|
253
76
|
}
|
|
254
77
|
const __mod__ = run()
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
`)
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
];
|
|
270
|
-
case 2:
|
|
271
|
-
return _state2.sent(), [
|
|
272
|
-
2
|
|
273
|
-
];
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
}))
|
|
277
|
-
];
|
|
278
|
-
});
|
|
279
|
-
}), _buildReactJSX.apply(this, arguments);
|
|
280
|
-
}
|
|
281
|
-
function buildReact() {
|
|
282
|
-
return _buildReact.apply(this, arguments);
|
|
78
|
+
${[
|
|
79
|
+
"jsx",
|
|
80
|
+
"jsxs",
|
|
81
|
+
"jsxDEV",
|
|
82
|
+
"Fragment"
|
|
83
|
+
].map(function(n) {
|
|
84
|
+
return `export const ${n} = __mod__.${n} || __mod__.jsx || ${/* @__PURE__ */ function() {
|
|
85
|
+
return n === "jsxs" ? "function (type, props, key) { return __mod__.jsxDEV(type, props, key, true) }" : "__mod__.jsxDEV";
|
|
86
|
+
}()}`;
|
|
87
|
+
}).join(`
|
|
88
|
+
`)}
|
|
89
|
+
`;
|
|
90
|
+
await import_fs_extra.default.writeFile(options.outfile, outCode);
|
|
91
|
+
});
|
|
283
92
|
}
|
|
284
|
-
function
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
external
|
|
307
|
-
}, options)).then(/* @__PURE__ */ _async_to_generator(function() {
|
|
308
|
-
var bundled, outCode;
|
|
309
|
-
return _ts_generator(this, function(_state2) {
|
|
310
|
-
switch (_state2.label) {
|
|
311
|
-
case 0:
|
|
312
|
-
return [
|
|
313
|
-
4,
|
|
314
|
-
(0, import_promises.readFile)(options.outfile, "utf-8")
|
|
315
|
-
];
|
|
316
|
-
case 1:
|
|
317
|
-
return bundled = _state2.sent(), outCode = `
|
|
93
|
+
async function buildReact() {
|
|
94
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
95
|
+
return (0, import_esbuild.build)({
|
|
96
|
+
bundle: !0,
|
|
97
|
+
entryPoints: [
|
|
98
|
+
resolveFile("react")
|
|
99
|
+
],
|
|
100
|
+
format: "cjs",
|
|
101
|
+
target: "node16",
|
|
102
|
+
jsx: "transform",
|
|
103
|
+
jsxFactory: "react",
|
|
104
|
+
allowOverwrite: !0,
|
|
105
|
+
platform: "node",
|
|
106
|
+
define: {
|
|
107
|
+
__DEV__: "true",
|
|
108
|
+
"process.env.NODE_ENV": '"development"'
|
|
109
|
+
},
|
|
110
|
+
logLevel: "warning",
|
|
111
|
+
external,
|
|
112
|
+
...options
|
|
113
|
+
}).then(async function() {
|
|
114
|
+
var bundled = await (0, import_promises.readFile)(options.outfile, "utf-8"), outCode = `
|
|
318
115
|
const run = () => {
|
|
319
|
-
|
|
116
|
+
${bundled.replace("module.exports = require_react_development();", "return require_react_development();")}
|
|
320
117
|
}
|
|
321
118
|
const __mod__ = run()
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
`)
|
|
119
|
+
${RExports.map(function(n) {
|
|
120
|
+
return `export const ${n} = __mod__.${n}`;
|
|
121
|
+
}).join(`
|
|
122
|
+
`)}
|
|
326
123
|
export default __mod__
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
];
|
|
331
|
-
case 2:
|
|
332
|
-
return _state2.sent(), [
|
|
333
|
-
2
|
|
334
|
-
];
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
}))
|
|
338
|
-
];
|
|
339
|
-
});
|
|
340
|
-
}), _buildReact.apply(this, arguments);
|
|
341
|
-
}
|
|
342
|
-
function buildReactNative() {
|
|
343
|
-
return _buildReactNative.apply(this, arguments);
|
|
124
|
+
`;
|
|
125
|
+
await import_fs_extra.default.writeFile(options.outfile, outCode);
|
|
126
|
+
});
|
|
344
127
|
}
|
|
345
|
-
function
|
|
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
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
return function(input) {
|
|
406
|
-
return _ref.apply(this, arguments);
|
|
407
|
-
};
|
|
408
|
-
}()), build2.onLoad({
|
|
409
|
-
filter: /.*.js/
|
|
410
|
-
}, function() {
|
|
411
|
-
var _ref = _async_to_generator(function(input) {
|
|
412
|
-
var code, outagain;
|
|
413
|
-
return _ts_generator(this, function(_state2) {
|
|
414
|
-
switch (_state2.label) {
|
|
415
|
-
case 0:
|
|
416
|
-
return !input.path.includes("react-native") && !input.path.includes("vite-native-hmr") ? [
|
|
417
|
-
2
|
|
418
|
-
] : [
|
|
419
|
-
4,
|
|
420
|
-
(0, import_promises.readFile)(input.path, "utf-8")
|
|
421
|
-
];
|
|
422
|
-
case 1:
|
|
423
|
-
return code = _state2.sent(), [
|
|
424
|
-
4,
|
|
425
|
-
(0, import_vite_flow.transformFlow)(code, {
|
|
426
|
-
development: !0
|
|
427
|
-
})
|
|
428
|
-
];
|
|
429
|
-
case 2:
|
|
430
|
-
return outagain = _state2.sent(), [
|
|
431
|
-
2,
|
|
432
|
-
{
|
|
433
|
-
contents: outagain,
|
|
434
|
-
loader: "jsx"
|
|
435
|
-
}
|
|
436
|
-
];
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
|
-
});
|
|
440
|
-
return function(input) {
|
|
441
|
-
return _ref.apply(this, arguments);
|
|
442
|
-
};
|
|
443
|
-
}());
|
|
444
|
-
}
|
|
128
|
+
async function buildReactNative() {
|
|
129
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
130
|
+
return (0, import_esbuild.build)({
|
|
131
|
+
bundle: !0,
|
|
132
|
+
entryPoints: [
|
|
133
|
+
resolveFile("react-native")
|
|
134
|
+
],
|
|
135
|
+
format: "cjs",
|
|
136
|
+
target: "node20",
|
|
137
|
+
// 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.
|
|
138
|
+
jsx: "transform",
|
|
139
|
+
jsxFactory: "react",
|
|
140
|
+
allowOverwrite: !0,
|
|
141
|
+
platform: "node",
|
|
142
|
+
external,
|
|
143
|
+
loader: {
|
|
144
|
+
".png": "dataurl",
|
|
145
|
+
".jpg": "dataurl",
|
|
146
|
+
".jpeg": "dataurl",
|
|
147
|
+
".gif": "dataurl"
|
|
148
|
+
},
|
|
149
|
+
define: {
|
|
150
|
+
__DEV__: "true",
|
|
151
|
+
"process.env.NODE_ENV": '"development"'
|
|
152
|
+
},
|
|
153
|
+
logLevel: "warning",
|
|
154
|
+
resolveExtensions: [
|
|
155
|
+
".ios.js",
|
|
156
|
+
".native.js",
|
|
157
|
+
".native.ts",
|
|
158
|
+
".native.tsx",
|
|
159
|
+
".js",
|
|
160
|
+
".jsx",
|
|
161
|
+
".json",
|
|
162
|
+
".ts",
|
|
163
|
+
".tsx",
|
|
164
|
+
".mjs"
|
|
165
|
+
],
|
|
166
|
+
...options,
|
|
167
|
+
plugins: [
|
|
168
|
+
{
|
|
169
|
+
name: "remove-flow",
|
|
170
|
+
setup(build2) {
|
|
171
|
+
build2.onResolve({
|
|
172
|
+
filter: /HMRClient/
|
|
173
|
+
}, async function(input) {
|
|
174
|
+
return {
|
|
175
|
+
path: resolveFile("@vxrn/vite-native-hmr")
|
|
176
|
+
};
|
|
177
|
+
}), build2.onLoad({
|
|
178
|
+
filter: /.*.js/
|
|
179
|
+
}, async function(input) {
|
|
180
|
+
if (!(!input.path.includes("react-native") && !input.path.includes("vite-native-hmr"))) {
|
|
181
|
+
var code = await (0, import_promises.readFile)(input.path, "utf-8"), outagain = await (0, import_vite_flow.transformFlow)(code, {
|
|
182
|
+
development: !0
|
|
183
|
+
});
|
|
184
|
+
return {
|
|
185
|
+
contents: outagain,
|
|
186
|
+
loader: "jsx"
|
|
187
|
+
};
|
|
445
188
|
}
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
return [
|
|
453
|
-
4,
|
|
454
|
-
(0, import_promises.readFile)(options.outfile, "utf-8")
|
|
455
|
-
];
|
|
456
|
-
case 1:
|
|
457
|
-
return bundled = _state2.sent(), outCode = `
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}).then(async function() {
|
|
194
|
+
var bundled = await (0, import_promises.readFile)(options.outfile, "utf-8"), outCode = `
|
|
458
195
|
const run = () => {
|
|
459
|
-
|
|
196
|
+
${bundled.replace(esbuildCommonJSFunction, `
|
|
460
197
|
// replaced commonjs function to allow importing internals
|
|
461
198
|
var __commonJS = (cb, mod) => function __require() {
|
|
462
199
|
if (mod) return mod
|
|
@@ -471,27 +208,16 @@ globalThis['__cachedModules'][path.replace(/.*node_modules\\//, '').replace('.js
|
|
|
471
208
|
|
|
472
209
|
return mod
|
|
473
210
|
};
|
|
474
|
-
`).replace("module.exports = require_react_native();", "return require_react_native();")
|
|
211
|
+
`).replace("module.exports = require_react_native();", "return require_react_native();")}
|
|
475
212
|
}
|
|
476
213
|
const RN = run()
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
`)
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
];
|
|
485
|
-
case 2:
|
|
486
|
-
return _state2.sent(), [
|
|
487
|
-
2
|
|
488
|
-
];
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
}))
|
|
492
|
-
];
|
|
493
|
-
});
|
|
494
|
-
}), _buildReactNative.apply(this, arguments);
|
|
214
|
+
${RNExportNames.map(function(n) {
|
|
215
|
+
return `export const ${n} = RN.${n}`;
|
|
216
|
+
}).join(`
|
|
217
|
+
`)}
|
|
218
|
+
`;
|
|
219
|
+
await import_fs_extra.default.writeFile(options.outfile, outCode);
|
|
220
|
+
});
|
|
495
221
|
}
|
|
496
222
|
var esbuildCommonJSFunction = `var __commonJS = (cb, mod) => function __require() {
|
|
497
223
|
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": "
|
|
5
|
-
"names": ["external", "buildAll", "console", "info", "Promise", "all", "buildReactJSX", "buildReact", "buildReactNative", "resolveFile", "path", "importMetaResolve", "process", "cwd", "replace", "require", "resolve", "options", "build", "bundle", "entryPoints", "format", "target", "jsx", "jsxFactory", "allowOverwrite", "platform", "define", "__DEV__", "logLevel", "then", "bundled", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;sBAAyB,6BAEzB,mBAA8B,4BAC9B,iBAAyC,oBACzC,kBAAoB,iCACpB,6BAA6C,gCAC7C,sBAAoB,qCAEdA,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,eAAOC,2BAAAA,SAAkBD,MAAM,UAAUE,oBAAAA,QAAQC,IAAG,CAAA,EAAI,EAAEC,QAAQ,WAAW,EAAA;EAC/E,QAAc;AACZ,WAAOC,QAAQC,QAAQN,IAAAA;EACzB;AACF;AAEA,eAAsBJ,gBAAAA;MA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,OAAA,GAC3CC,UAAU;;QAEZH,QACCjB,QACC0C,yBACA;;;;;;;;;;;;;;;CAeT,EAEQ1C,QAAQ,4CAA4C,gCAAgC,CAAA;;;MAGvF2C,cAActB,IAAI,SAACC,GAAAA;aAAM,gBAAgBA,CAAAA,SAAUA,CAAAA;OAAKC,KAAK;CAAA,CAAA;;AAE/D,UAAMC,gBAAAA,QAAQC,UAAUtB,QAAQgB,SAAUC,OAAAA;EAC5C,CAAA;AACF;AAEA,IAAMsB,0BAA0B;;KAI1BC,gBAAgB;EACpB;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;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GAGIjB,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": ["external", "buildAll", "console", "info", "Promise", "all", "buildReactJSX", "buildReact", "buildReactNative", "resolveFile", "path", "importMetaResolve", "process", "cwd", "replace", "require", "resolve", "options", "build", "bundle", "entryPoints", "format", "target", "jsx", "jsxFactory", "allowOverwrite", "platform", "define", "__DEV__", "logLevel", "then", "bundled", "readFile", "outfile", "outCode", "map", "n", "join", "FSExtra", "writeFile", "RExports", "loader", "resolveExtensions", "plugins", "name", "setup", "onResolve", "filter", "input", "onLoad", "includes", "code", "outagain", "transformFlow", "development", "contents", "esbuildCommonJSFunction", "RNExportNames"]
|
|
6
6
|
}
|