miaoda-expo-devkit 0.1.1-beta.37 → 0.1.1-beta.38
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/metro.d.mts +15 -1
- package/dist/metro.d.ts +15 -1
- package/dist/metro.js +16 -0
- package/dist/metro.mjs +15 -0
- package/package.json +1 -1
package/dist/metro.d.mts
CHANGED
|
@@ -112,6 +112,7 @@ declare function withRouteEndpoint(config: MetroConfig, options: RouteEndpointOp
|
|
|
112
112
|
*
|
|
113
113
|
* 按固定顺序依次应用:
|
|
114
114
|
* withWorkspaceNodeModules — 修复沙箱中 node_modules 位于祖先目录时的模块解析问题
|
|
115
|
+
* withWasmSupport — 将 .wasm 加入 assetExts,修复 expo-sqlite web worker 打包失败
|
|
115
116
|
* withCssInterop — 为 expo-image / expo-camera 等注入 NativeWind cssInterop
|
|
116
117
|
* withEsbuildMinify — 将 Metro minifier 切换为 esbuild(仅生产构建生效)
|
|
117
118
|
* withLucideResolver — 消除 lucide 子路径未在 exports 声明时的 warning
|
|
@@ -288,4 +289,17 @@ declare function withExpoMediaLibraryStub(config: MetroConfig): MetroConfig;
|
|
|
288
289
|
*/
|
|
289
290
|
declare function withEsbuildMinify(config: MetroConfig): MetroConfig;
|
|
290
291
|
|
|
291
|
-
|
|
292
|
+
/**
|
|
293
|
+
* withWasmSupport — 为 Metro 添加 .wasm 静态资源支持
|
|
294
|
+
*
|
|
295
|
+
* expo-sqlite 的 web worker(web/worker.ts)通过 ES import 加载
|
|
296
|
+
* wa-sqlite.wasm,Metro 默认 assetExts 不含 wasm,打包时报:
|
|
297
|
+
* Unable to resolve "./wa-sqlite/wa-sqlite.wasm" from "expo-sqlite/web/worker.ts"
|
|
298
|
+
*
|
|
299
|
+
* 将 wasm 加入 assetExts 后,Metro resolver 遇到 .wasm 导入时会将其
|
|
300
|
+
* 作为静态资源处理(同 ttf/png),不再尝试作为 JS 模块解析。
|
|
301
|
+
*/
|
|
302
|
+
|
|
303
|
+
declare function withWasmSupport(config: MetroConfig): MetroConfig;
|
|
304
|
+
|
|
305
|
+
export { type DevkitOptions, type InjectOptions, type PatchNativeWindCacheOptions, type RouteEndpointOptions, patchNativeWindCachePath, withCssInterop, withDevStubs, withDevkit, withEntryInjection, withEsbuildMinify, withExpoMediaLibraryStub, withExpoNotificationsStub, withLucideResolver, withNativeWind, withRouteEndpoint, withWasmSupport, withWorkspaceNodeModules };
|
package/dist/metro.d.ts
CHANGED
|
@@ -112,6 +112,7 @@ declare function withRouteEndpoint(config: MetroConfig, options: RouteEndpointOp
|
|
|
112
112
|
*
|
|
113
113
|
* 按固定顺序依次应用:
|
|
114
114
|
* withWorkspaceNodeModules — 修复沙箱中 node_modules 位于祖先目录时的模块解析问题
|
|
115
|
+
* withWasmSupport — 将 .wasm 加入 assetExts,修复 expo-sqlite web worker 打包失败
|
|
115
116
|
* withCssInterop — 为 expo-image / expo-camera 等注入 NativeWind cssInterop
|
|
116
117
|
* withEsbuildMinify — 将 Metro minifier 切换为 esbuild(仅生产构建生效)
|
|
117
118
|
* withLucideResolver — 消除 lucide 子路径未在 exports 声明时的 warning
|
|
@@ -288,4 +289,17 @@ declare function withExpoMediaLibraryStub(config: MetroConfig): MetroConfig;
|
|
|
288
289
|
*/
|
|
289
290
|
declare function withEsbuildMinify(config: MetroConfig): MetroConfig;
|
|
290
291
|
|
|
291
|
-
|
|
292
|
+
/**
|
|
293
|
+
* withWasmSupport — 为 Metro 添加 .wasm 静态资源支持
|
|
294
|
+
*
|
|
295
|
+
* expo-sqlite 的 web worker(web/worker.ts)通过 ES import 加载
|
|
296
|
+
* wa-sqlite.wasm,Metro 默认 assetExts 不含 wasm,打包时报:
|
|
297
|
+
* Unable to resolve "./wa-sqlite/wa-sqlite.wasm" from "expo-sqlite/web/worker.ts"
|
|
298
|
+
*
|
|
299
|
+
* 将 wasm 加入 assetExts 后,Metro resolver 遇到 .wasm 导入时会将其
|
|
300
|
+
* 作为静态资源处理(同 ttf/png),不再尝试作为 JS 模块解析。
|
|
301
|
+
*/
|
|
302
|
+
|
|
303
|
+
declare function withWasmSupport(config: MetroConfig): MetroConfig;
|
|
304
|
+
|
|
305
|
+
export { type DevkitOptions, type InjectOptions, type PatchNativeWindCacheOptions, type RouteEndpointOptions, patchNativeWindCachePath, withCssInterop, withDevStubs, withDevkit, withEntryInjection, withEsbuildMinify, withExpoMediaLibraryStub, withExpoNotificationsStub, withLucideResolver, withNativeWind, withRouteEndpoint, withWasmSupport, withWorkspaceNodeModules };
|
package/dist/metro.js
CHANGED
|
@@ -41,6 +41,7 @@ __export(metro_exports, {
|
|
|
41
41
|
withLucideResolver: () => withLucideResolver,
|
|
42
42
|
withNativeWind: () => withNativeWind,
|
|
43
43
|
withRouteEndpoint: () => withRouteEndpoint,
|
|
44
|
+
withWasmSupport: () => withWasmSupport,
|
|
44
45
|
withWorkspaceNodeModules: () => withWorkspaceNodeModules
|
|
45
46
|
});
|
|
46
47
|
module.exports = __toCommonJS(metro_exports);
|
|
@@ -383,11 +384,25 @@ function withExpoMediaLibraryStub(config) {
|
|
|
383
384
|
return { ...config, resolver: { ...config.resolver, resolveRequest } };
|
|
384
385
|
}
|
|
385
386
|
|
|
387
|
+
// src/metro/withWasmSupport.ts
|
|
388
|
+
function withWasmSupport(config) {
|
|
389
|
+
const existing = config.resolver?.assetExts ?? [];
|
|
390
|
+
if (existing.includes("wasm")) return config;
|
|
391
|
+
return {
|
|
392
|
+
...config,
|
|
393
|
+
resolver: {
|
|
394
|
+
...config.resolver,
|
|
395
|
+
assetExts: [...existing, "wasm"]
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
|
|
386
400
|
// src/metro/withDevkit.ts
|
|
387
401
|
function withDevkit(config, options = {}) {
|
|
388
402
|
const projectRoot = config.projectRoot ?? process.cwd();
|
|
389
403
|
const { input = "./src/global.css" } = options;
|
|
390
404
|
config = withWorkspaceNodeModules(config);
|
|
405
|
+
config = withWasmSupport(config);
|
|
391
406
|
config = withCssInterop(config);
|
|
392
407
|
config = withEsbuildMinify(config);
|
|
393
408
|
config = withLucideResolver(config);
|
|
@@ -421,6 +436,7 @@ try {
|
|
|
421
436
|
withLucideResolver,
|
|
422
437
|
withNativeWind,
|
|
423
438
|
withRouteEndpoint,
|
|
439
|
+
withWasmSupport,
|
|
424
440
|
withWorkspaceNodeModules
|
|
425
441
|
});
|
|
426
442
|
//# sourceMappingURL=metro.js.map
|
package/dist/metro.mjs
CHANGED
|
@@ -343,11 +343,25 @@ function withExpoMediaLibraryStub(config) {
|
|
|
343
343
|
return { ...config, resolver: { ...config.resolver, resolveRequest } };
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
+
// src/metro/withWasmSupport.ts
|
|
347
|
+
function withWasmSupport(config) {
|
|
348
|
+
const existing = config.resolver?.assetExts ?? [];
|
|
349
|
+
if (existing.includes("wasm")) return config;
|
|
350
|
+
return {
|
|
351
|
+
...config,
|
|
352
|
+
resolver: {
|
|
353
|
+
...config.resolver,
|
|
354
|
+
assetExts: [...existing, "wasm"]
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
|
|
346
359
|
// src/metro/withDevkit.ts
|
|
347
360
|
function withDevkit(config, options = {}) {
|
|
348
361
|
const projectRoot = config.projectRoot ?? process.cwd();
|
|
349
362
|
const { input = "./src/global.css" } = options;
|
|
350
363
|
config = withWorkspaceNodeModules(config);
|
|
364
|
+
config = withWasmSupport(config);
|
|
351
365
|
config = withCssInterop(config);
|
|
352
366
|
config = withEsbuildMinify(config);
|
|
353
367
|
config = withLucideResolver(config);
|
|
@@ -380,6 +394,7 @@ export {
|
|
|
380
394
|
withLucideResolver,
|
|
381
395
|
withNativeWind,
|
|
382
396
|
withRouteEndpoint,
|
|
397
|
+
withWasmSupport,
|
|
383
398
|
withWorkspaceNodeModules
|
|
384
399
|
};
|
|
385
400
|
//# sourceMappingURL=metro.mjs.map
|